- Jan 29, 2025
-
-
command-bot authored
"$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --features=insecure_zero_ed --pallet=pallet_balances
-
Manuel Mauro authored
-
Manuel Mauro authored
-
Manuel Mauro authored
-
- Jan 28, 2025
-
-
Maksym H authored
-
Maksym H authored
- remove old bench from cmd.py and left alias for backward compatibility - reverted the frame-wight-template as the problem was that it umbrella template wasn't picked correctly in the old benchmarks, in frame-omni-bench it correctly identifies the dependencies and uses correct template --------- Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
-
Alexander Samusev authored
cc https://github.com/paritytech/ci_cd/issues/1101
-
Dmitry Markin authored
Instead of using libp2p-provided external address candidates, susceptible to address translation issues, use litep2p-backend approach based on confirming addresses observed by multiple peers as external. Fixes https://github.com/paritytech/polkadot-sdk/issues/7207. --------- Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
-
Sebastian Kunert authored
The old error message was often confusing, because the real reason for the error will be printed during inherent execution. --------- Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
-
Andrew Jones authored
Closes #216. This PR allows pallets to define a `view_functions` impl like so: ```rust #[pallet::view_functions] impl<T: Config> Pallet<T> where T::AccountId: From<SomeType1> + SomeAssociation1, { /// Query value no args. pub fn get_value() -> Option<u32> { SomeValue::<T>::get() } /// Query value with args. pub fn get_value_with_arg(key: u32) -> Option<u32> { SomeMap::<T>::get(key) } } ``` ### `QueryId` Each view function is uniquely identified by a `QueryId`, which for this implementation is generated by: ```twox_128(pallet_name) ++ twox_128("fn_name(fnarg_types) -> return_ty")``` The prefix `twox_128(pallet_name)` is the same as the storage prefix for pallets and take into account multiple instances of the same pallet. The suffix is generated from the fn type signature so is guaranteed to be unique for that pallet impl. For one of the view fns in the example above it would be `twox_128("get_value_with_arg(u32) -> Option<u32>")`. It is a known limitation that only the type names themselves are taken into account: in the case of type aliases the signature may have the same underlying types but a different id; for generics the concrete types may be different but the signatures will remain the same. The existing Runtime `Call` dispatchables are addressed by their concatenated indices `pallet_index ++ call_index`, and the dispatching is handled by the SCALE decoding of the `RuntimeCallEnum::PalletVariant(PalletCallEnum::dispatchable_variant(payload))`. For `view_functions` the runtime/pallet generated enum structure is replaced by implementing the `DispatchQuery` trait on the outer (runtime) scope, dispatching to a pallet based on the id prefix, and the inner (pallet) scope dispatching to the specific function based on the id suffix. Future implementations could also modify/extend this scheme and routing to pallet agnostic queries. ### Executing externally These view functions can be executed externally via the system runtime api: ```rust pub trait ViewFunctionsApi<QueryId, Query, QueryResult, Error> where QueryId: codec::Codec, Query: codec::Codec, QueryResult: codec::Codec, Error: codec::Codec, { /// Execute a view function query. fn execute_query(query_id: QueryId, query: Query) -> Result<QueryResult, Error>; } ``` ### `XCQ` Currently there is work going on by @xlc to implement [`XCQ`](https://github.com/open-web3-stack/XCQ/) which may eventually supersede this work. It may be that we still need the fixed function local query dispatching in addition to XCQ, in the same way that we have chain specific runtime dispatchables and XCM. I have kept this in mind and the high level query API is agnostic to the underlying query dispatch and execution. I am just providing the implementation for the `view_function` definition. ### Metadata Currently I am utilizing the `custom` section of the frame metadata, to avoid modifying the official metadata format until this is standardized. ### vs `runtime_api` There are similarities with `runtime_apis`, some differences being: - queries can be defined directly on pallets, so no need for boilerplate declarations and implementations - no versioning, the `QueryId` will change if the signature changes. - possibility for queries to be executed from smart contracts (see below) ### Calling from contracts Future work would be to add `weight` annotations to the view function queries, and a host function to `pallet_contracts` to allow executing these queries from contracts. ### TODO - [x] Consistent naming (view functions pallet impl, queries, high level api?) - [ ] End to end tests via `runtime_api` - [ ] UI tests - [x] Mertadata tests - [ ] Docs --------- Co-authored-by:
kianenigma <kian@parity.io> Co-authored-by:
James Wilson <james@jsdw.me> Co-authored-by:
Giuseppe Re <giuseppe.re@parity.io> Co-authored-by:
Guillaume Thiolliere <guillaume.thiolliere@parity.io>
-
xermicus authored
This PR changes how we call runtime API methods with more than 6 arguments: They are no longer spilled to the stack but packed into registers instead. Pointers are 32 bit wide so we can pack two of them into a single 64 bit register. Since we mostly pass pointers, this technique effectively increases the number of arguments we can pass using the available registers. To make this work for `instantiate` too we now pass the code hash and the call data in the same buffer, akin to how the `create` family opcodes work in the EVM. The code hash is fixed in size, implying the start of the constructor call data. --------- Signed-off-by:
xermicus <cyrill@parity.io> Signed-off-by:
Cyrill Leutwiler <bigcyrill@hotmail.com> Co-authored-by: command-bot <> Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by:
Alexander Theißen <alex.theissen@me.com>
-
Alin Dima authored
On top of https://github.com/paritytech/polkadot-sdk/pull/6757 Fixes https://github.com/paritytech/polkadot-sdk/issues/6858 by bumping the `PARENT_SEARCH_DEPTH` constant to a larger value (30) and adds a zombienet-sdk test that exercises the 12-core scenario. This is a node-side limit that restricts the number of allowed pending availability candidates when choosing the parent parablock during authoring. This limit is rather redundant, as the parachain runtime already restricts the unincluded segment length to the configured value in the [FixedVelocityConsensusHook](https://github.com/paritytech/polkadot-sdk/blob/88d900af /cumulus/pallets/aura-ext/src/consensus_hook.rs#L35) (which ideally should be equal to this `PARENT_SEARCH_DEPTH`). For 12 cores, a value of 24 should be enough, but I bumped it to 30 to have some extra buffer. There are two other potential ways of fixing this: - remove this constant altogether, as the parachain runtime already makes those guarantees. Chose not to do this, as it can't hurt to have an extra safeguard - set this value to be equal to the uninlcuded segment size. This value however is not exposed to the node-side and would require a new runtime API, which seems overkill for a redundant check. --------- Co-authored-by:
Javier Viola <javier@parity.io>
-
- Jan 27, 2025
-
-
Ron authored
Resolves (partially): https://github.com/paritytech/polkadot-sdk/issues/7148 (see _Problem 1 - `ShouldExecute` tuple implementation and `Deny` filter tuple_) This PR changes the behavior of `DenyThenTry` from the pattern `DenyIfAllMatch` to `DenyIfAnyMatch` for the tuple. I would expect the latter is the right behavior so make the fix in place, but we can also add a dedicated Impl with the legacy one untouched. ## TODO - [x] add unit-test for `DenyReserveTransferToRelayChain` - [x] add test and investigate/check `DenyThenTry` as discussed [here](https://github.com/paritytech/polkadot-sdk/pull/6838#discussion_r1914553990) and update documentation if needed --------- Co-authored-by:
Branislav Kontur <bkontur@gmail.com> Co-authored-by:
Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: command-bot <> Co-authored-by:
Clara van Staden <claravanstaden64@gmail.com> Co-authored-by:
Adrian Catangiu <adrian@parity.io>
-
Ludovic_Domingues authored
#Description Migrated polkadot-runtime-parachains slots benchmarking to the new benchmarking syntax v2. This is part of #6202 --------- Co-authored-by:
Giuseppe Re <giuseppe.re@parity.io> Co-authored-by:
seemantaggarwal <32275622+seemantaggarwal@users.noreply.github.com> Co-authored-by:
Bastian Köcher <git@kchr.de>
-
christopher k authored
# Description This PR adds development chain specs for the minimal and parachain templates. [#6334](https://github.com/paritytech/polkadot-sdk/issues/6334) ## Integration This PR adds development chain specs for the minimal and para chain template runtimes, ensuring synchronization with runtime code. It updates zombienet-omni-node.toml, zombinet.toml files to include valid chain spec paths, simplifying configuration for zombienet in the parachain and minimal template. ## Review Notes 1. Overview of Changes: - Added development chain specs for use in the minimal and parachain template. - Updated zombienet-omni-node.toml and zombinet.toml files in the minimal and parachain templates to include paths to the new dev chain specs. 2. Integration Guidance: **NB: Follow the templates' READMEs from the polkadot-SDK master branch. Please build the binaries and runtimes based on the polkadot-SDK master branch.** - Ensure you have set up your runtimes `parachain-template-runtime` and `minimal-template-runtime` - Ensure you have installed the nodes required ie `parachain-template-node` and `minimal-template-node` - Set up [Zombinet](https://paritytech.github.io/zombienet/intro.html) - For running the parachains, you will need to install the polkadot `cargo install --path polkadot` remember from the polkadot-SDK master branch. - Inside the template folders minimal or parachain, run the command to start with `Zombienet with Omni Node`, `Zombienet with minimal-template-node` or `Zombienet with parachain-template-node` *Include your leftover TODOs, if any, here.* * [ ] Test the syncing of chain specs with runtime's code. --------- Signed-off-by:
EleisonC <ckalule7@gmail.com> Co-authored-by:
Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com> Co-authored-by:
Alexander Samusev <41779041+alvicsam@users.noreply.github.com>
-
dharjeezy authored
closes #5978 --------- Co-authored-by: command-bot <> Co-authored-by:
Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
-
Dmitry Markin authored
Revert https://github.com/paritytech/polkadot-sdk/pull/7011 and replace it with a backward-compatible solution suitable for backporting to a release branch. ### Review notes It's easier to review this PR per commit: the first commit is just a revert, so it's enough to review only the second one, which is almost a one-liner. --------- Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
-
- Jan 26, 2025
-
-
Branislav Kontur authored
Part of: https://github.com/paritytech/polkadot-sdk/issues/6906
-
- Jan 25, 2025
-
-
thiolliere authored
Improve debugging by using `#[track_caller]` in system `assert_last_event` and `assert_has_event` (#7142) Without track caller the error message of the assert points to the `assert_last_event` function, which is not useful. ``` thread 'tests::set_metadata_works' panicked at /home/gui/Developpement/polkadot-sdk/substrate/frame/system/src/lib.rs:2034:9: assertion `left == right` failed: expected event RuntimeEvent::Referenda(Event::MetadataSet { index: 0, hash: 0xbb30a42c1e62f0afda5f0a4e8a562f7a13a24cea00ee81917b86b89e801314aa }) is not equal to the last event RuntimeEvent::Referenda(Event::MetadataSet { index: 1, hash: 0xbb30a42c1e62f0afda5f0a4e8a562f7a13a24cea00ee81917b86b89e801314aa }) left: RuntimeEvent::Referenda(Event::MetadataSet { index: 1, hash: 0xbb30a42c1e62f0afda5f0a4e8a562f7a13a24cea00ee81917b86b89e801314aa }) right: RuntimeEvent::Referenda(Event::MetadataSet { index: 0, hash: 0xbb30a42c1e62f0afda5f0a4e8a562f7a13a24cea00ee81917b86b89e801314aa }) ``` With the track caller the error message points to the caller, showing the source of the error: ``` thread 'tests::set_metadata_works' panicked at substrate/frame/referenda/src/tests.rs:639:9: assertion `left == right` failed: expected event RuntimeEvent::Referenda(Event::MetadataSet { index: 0, hash: 0xbb30a42c1e62f0afda5f0a4e8a562f7a13a24cea00ee81917b86b89e801314aa }) is not equal to the last event RuntimeEvent::Referenda(Event::MetadataSet { index: 1, hash: 0xbb30a42c1e62f0afda5f0a4e8a562f7a13a24cea00ee81917b86b89e801314aa }) left: RuntimeEvent::Referenda(Event::MetadataSet { index: 1, hash: 0xbb30a42c1e62f0afda5f0a4e8a562f7a13a24cea00ee81917b86b89e801314aa }) right: RuntimeEvent::Referenda(Event::MetadataSet { index: 0, hash: 0xbb30a42c1e62f0afda5f0a4e8a562f7a13a24cea00ee81917b86b89e801314aa }) ``` I also improved the error message to include a warning when checking events on block number zero.
-
thiolliere authored
`set_validation_data` register weight manually, do not use refund when the pre dispatch is zero. (#7327) Related https://github.com/paritytech/polkadot-sdk/issues/6772 For an extrinsic, in the post dispatch info, the actual weight is only used to reclaim unused weight. If the actual weight is more than the pre dispatch weight, then the extrinsic is using the minimum, e.g., the weight used registered in pre dispatch. In parachain-system pallet one call is `set_validation_data`. This call is returning an actual weight, but the pre-dispatch weight is 0. This PR fix the disregard of actual weight of `set_validation_data` by registering it manually.
-
- Jan 24, 2025
-
-
Andrei Eres authored
The link to Polkachu is not working
-
Alexander Theißen authored
This regression was introduced with some of the recent PRs. Regression fixed and test added. --------- Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
-
PG Herveou authored
- Add option to specify database_url using DATABASE_URL environment variable - Add a eth-rpc-tester rust bin that can be used to test deployment before releasing eth-rpc - make evm_block non fallible so that it can return an Ok response for older blocks when the runtime API is not available - update cargo.lock to integrate changes from https://github.com/paritytech/subxt/pull/1904 --------- Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
-
Iulian Barbu authored
# Description We're unable to sync templates repos with what's in polkadot-sdk/templates for stable2412 because the tag which references the release (`polkadot-stable2412`) is missing the Plan.toml file, which is needed by PSVM, ran when syncing, to update the templates dependencies versions in Cargo.tomls. This PR adds a workflow `patch` input, to enable the workflow to use PSVM with a tag corresponding to a patch stable release (e.g. `polkadot-stable2412-1`), which will contain the `Plan.toml` file. ## Integration This enables the templates repos update with the contents of latest stable2412 release, in terms of polkadot-sdk/templates, which is relevant for getting-started docs. ## Review Notes This PR adds a `patch` input for the `misc-sync-templates.yml` workflow, which if set will be used with `psvm` accordingly to update templates repos' dependencies versions based on upcomming patch stable2412-1, which contains the `Plan.toml`. The workflow will be ran manually after stable2412-1 is out and this work is tracked under #6329 . Signed-off-by:
Iulian Barbu <iulian.barbu@parity.io>
-
Branislav Kontur authored
This PR includes minor fixes identified during work on the larger PR: [https://github.com/paritytech/polkadot-sdk/issues/6906](https://github.com/paritytech/polkadot-sdk/issues/6906). Specifically, this PR removes the use of `open_bridge_between_asset_hub_rococo_and_asset_hub_westend`, which is no longer relevant for BridgeHubs, as bridges are now created with genesis settings. This function was used in the generic `test_dry_run_transfer_across_pk_bridge` macro, which could cause compilation issues when used in other contexts (e.g. fellows repo). --------- Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
-
Iulian Barbu authored
# Description This PR builds frame-omni-bencher with `production` profile when calling `/cmd bench-omni` to compute benchmarks for pallets. Fix proposed by @bkchr , thanks! Closes #6797. ## Integration N/A ## Review Notes More info on #6797, and related to how the fix was tested: https://github.com/paritytech/polkadot-sdk/issues/6797#issuecomment-2611903102. --------- Signed-off-by:
Iulian Barbu <iulian.barbu@parity.io> Co-authored-by: command-bot <>
-
Branislav Kontur authored
Closes: https://github.com/paritytech/polkadot-sdk/issues/2904 --------- Co-authored-by: command-bot <>
-
Maksym H authored
Closes #6196 Closes #7204 Example of PR: https://github.com/paritytech/polkadot-sdk/pull/6816 Every sunday 01:00 AM it's going to start to benchmark (with /cmd bench) all runtimes and all pallets Then diff total will be pushed to a branch and PR open,. I assume review-bot is going assign required reviewers per changed files I afraid each weeks will be too much to review & merge, but we can adjust later Bonus: fix for pallet_multisig lib and substrate/.maintain/frame-weight-template.hbs , which didn't let to compile new weights --------- Signed-off-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: command-bot <> Co-authored-by:
cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by:
Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
-
- Jan 23, 2025
-
-
Andrei Sandu authored
Currently the `para_backing_state` API is used only by the prospective parachains subsystems and returns 2 things: the constraints for parachain blocks and the candidates pending availability. This PR deprecates `para_backing_state` and introduces a new `backing_constraints` API that can be used together with `candidates_pending_availability` to get the same information provided by `para_backing_state`. TODO: - [x] PRDoc --------- Signed-off-by:
Andrei Sandu <andrei-mihail@parity.io> Co-authored-by: command-bot <>
-
Maksym H authored
Fixed condition which sets weights/large images
-
Maksym H authored
Aims to - close #7049 - close https://github.com/paritytech/opstooling/issues/449 - close https://github.com/paritytech/opstooling/issues/463 What's changed: - removed is paritytech member check as required prerequisite to run a command - run the cmd.py script taking it from master, if someone who run this is not a member of paritytech, and from current branch, if is a member. That keeps the developer experience & easy testing if paritytech members are contributing to cmd.py - isolate the cmd job from being able to access GH App token or PR token- currently the fmt/bench/prdoc are being run with limited permissions scope, just to generate output, which then is uploaded to artifacts, and then the other job which doesn't run any files from repo, does a commit/push more securely
-
Alin Dima authored
This is the right value after https://github.com/paritytech/polkadot-sdk/pull/4880, which corresponds to an allowedAncestryLen of 2 (which is the default) WIll fix https://github.com/paritytech/polkadot-sdk/issues/7105
-
Branislav Kontur authored
This PR contains small fixes identified during work on the larger PR: https://github.com/paritytech/polkadot-sdk/issues/6906. --------- Co-authored-by: command-bot <>
-
Alisher A. Khassanov authored
# Description Closes https://github.com/paritytech/polkadot-sdk/issues/7265. ## Integration Requires changes in `https://github.com/polkadot-js/api/packages/{rpc-augment,types-support,types}` to be visible in Polkadot\Substrate Portal and in other libraries where we should explicitly state RPC methods. Accompany PR to `polkadot-js/api`: https://github.com/polkadot-js/api/pull/6070. ## Review Notes Please put the right label on my PR. --------- Co-authored-by: command-bot <> Co-authored-by:
Bastian Köcher <git@kchr.de>
-
runcomet authored
# Derived Dev Accounts Resolves https://github.com/paritytech/polkadot-sdk/issues/6040 ## Description This update introduces support for creating an arbitrary number of developer accounts at the genesis block based on a specified derivation path. This functionality is gated by the runtime-benchmarks feature, ensuring it is only enabled during benchmarking scenarios. ### Key Features - Arbitrary Dev Accounts at Genesis: Developers can now specify any number of accounts to be generated at genesis using a hard derivation path. - Default Derivation Path: If no derivation path is provided (i.e., when `Option<dev_accounts: (..., None)>` is set to `Some` at genesis), the system will default to the path `//Sender//{}`. - No Impact on Total Token Issuance: Developer accounts are excluded from the total issuance of the token supply at genesis, ensuring they do not affect the overall balance or token distribution. polkadot address: 14SRqZTC1d8rfxL8W1tBTnfUBPU23ACFVPzp61FyGf4ftUFg --------- Co-authored-by:
Sebastian Kunert <skunert49@gmail.com>
-
Egor_P authored
This PR contains a fix for the rc-build release pipeline. The problem was, that for the deb package build were all the artefacts downloaded and merged together, what could lead to the issue, that the polkadot linux binary was overwritten with the macos one.
-
PG Herveou authored
- Fix the EVM fee cost estimation. The estimation shown in EVM wallet was using Native instead of EVM decimals - Remove the precise code length estimation in dry run call. Over-estimating is fine, since extra gas is refunded anyway. - Ensure that the estimated fee calculated from gas_price x gas use the encoded weight & deposit limit instead of the exact one calculated by the dry-run. Else we can end up with a fee that is lower than the actual fee paid by the user --------- Co-authored-by: command-bot <>
-
- Jan 22, 2025
-
-
FereMouSiopi authored
Part of https://github.com/paritytech/polkadot-sdk/issues/6504 --------- Co-authored-by: command-bot <> Co-authored-by:
Bastian Köcher <git@kchr.de>
-
Alexandru Vasile authored
This PR enforces that outbound requests are finished within the specified protocol timeout. The stable2412 version running libp2p 0.52.4 contains a bug which does not track request timeouts properly: - https://github.com/libp2p/rust-libp2p/pull/5429 The issue has been detected while submitting libp2p -> litep2p requests in kusama. This aims to check that pending outbound requests have not timedout. Although the issue has been fixed in libp2p, there might be other cases where this may happen. For example: - https://github.com/libp2p/rust-libp2p/pull/5417 For more context see: https://github.com/paritytech/polkadot-sdk/issues/7076#issuecomment-2596085096 1. Ideally, the force-timeout mechanism in this PR should never be triggered in production. However, origin/stable2412 occasionally encounters this issue. When this happens, 2 warnings may be generated: - one warning introduced by this PR wrt force timeout terminating the request - possible one warning when the libp2p decides (if at all) to provide the response back to substrate (as mentioned by @alexggh [here](https://github.com/paritytech/polkadot-sdk/pull/7222/files#diff-052aeaf79fef3d9a18c2cfd67006aa306b8d52e848509d9077a6a0f2eb856af7L769) and [here](https://github.com/paritytech/polkadot-sdk/pull/7222/files#diff-052aeaf79fef3d9a18c2cfd67006aa306b8d52e848509d9077a6a0f2eb856af7L842) 2. This implementation does not propagate to the substrate service the `RequestFinished { error: .. }`. That event is only used internally by substrate to increment metrics. However, we don't have the peer information available to propagate the event properly when we force-timeout the request. Considering this should most likely not happen in production (origin/master) and that we'll be able to extract information by warnings, I would say this is a good tradeoff for code simplicity: https://github.com/paritytech/polkadot-sdk/blob/06e3b5c6 /substrate/client/network/src/service.rs#L1543 ### Testing Added a new test to ensure the timeout is reached properly, even if libp2p does not produce a response in due time. I've also transitioned the tests to using `tokio::test` due to a limitation of [CI](https://github.com/paritytech/polkadot-sdk/actions/runs/12832055737/job/35784043867) ``` --- TRY 1 STDERR: sc-network request_responses::tests::max_response_size_exceeded --- thread 'request_responses::tests::max_response_size_exceeded' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/time/interval.rs:139:26: there is no reactor running, must be called from the context of a Tokio 1.x runtime ``` cc @paritytech/networking --------- Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by:
Bastian Köcher <git@kchr.de>
-
Mrisho Lukamba authored
Closes #7055 @skunert @bkchr --------- Co-authored-by:
Bastian Köcher <git@kchr.de> Co-authored-by: command-bot <> Co-authored-by:
Sebastian Kunert <skunert49@gmail.com>
-