Commit Graph

16878 Commits

Author SHA1 Message Date
gui ca7c01c8d8 Improve doc for pallet macro and config macro (#4146)
Improve doc:

* the pallet macro is actually referring to 2 places, for the module and
for the struct placeholder but doesn't really clarify it (I should have
named the latter just `pallet_struct` or something but it is a bit late)

* The doc of `with_default` is a bit confusing too IMO.

CC @kianenigma

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
2024-04-17 15:22:46 +00:00
Muharem 4e10d3b0a6 Asset Conversion: Pool Account ID derivation with additional Pallet ID seed (#3250)
Introduce `PalletId` as an additional seed parameter for pool's account
id derivation.

The PR also introduces the `pallet_asset_conversion_ops` pallet with a
call to migrate a given pool to thew new account. Additionally
`fungibles::lifetime::ResetTeam` and `fungible::lifetime::Refund`
traits, to facilitate the migration of pools.

---------

Co-authored-by: command-bot <>
2024-04-17 10:39:23 +00:00
Sergej Sakac e6f3106d89 XCM coretime region transfers (#3455)
This PR introduces changes enabling the transfer of coretime regions via
XCM.

TL;DR: There are two primary issues that are resolved in this PR:

1. The `mint` and `burn` functions were not implemented for coretime
regions. These operations are essential for moving assets to and from
the XCM holding register.
2. The transfer of non-fungible assets through XCM was previously
disallowed. This was due to incorrectly benchmarking non-fungible asset
transfers via XCM, which led to assigning it a weight of `Weight::Max`,
effectively preventing its execution.

### `mint_into` and `burn` implementation

This PR addresses the issue with cross-chain transferring regions back
to the Coretime chain. Remote reserve transfers are performed by
withdrawing and depositing the asset to and from the holding registry.
This requires the asset to support burning and minting functionality.

This PR adds burning and minting; however, they work a bit differently
than usual so that the associated region record is not lost when
burning. Instead of removing all the data, burning will set the owner of
the region to `None`, and when minting it back, it will set it to an
actual value. So, when cross-chain transferring, withdrawing into the
registry will remove the region from its original owner, and when
depositing it from the registry, it will set its owner to another
account

This was originally implemented in this PR: #3455, however we decided to
move all of it to this single PR
(https://github.com/paritytech/polkadot-sdk/pull/3455#discussion_r1547324892)

### Fixes made in this PR

- Update the `XcmReserveTransferFilter` on coretime chain since it is
meant as a reserve chain for coretime regions.
- Update the XCM benchmark to use `AssetTransactor` instead of assuming
`pallet-balances` for fungible transfers.
- Update the XCM benchmark to properly measure weight consumption for
nonfungible reserve asset transfers. ATM reserve transfers via the
extrinsic do not work since the weight for it is set to `Weight::max()`.

Closes: https://github.com/paritytech/polkadot-sdk/issues/865

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Dónal Murray <donalm@seadanda.dev>
2024-04-17 09:25:33 +00:00
Branislav Kontur 4be9f93cd7 Adjust xcm-bridge-hub-router's SendXcm::validate behavior for NotApplicable (#4162)
This PR adjusts `xcm-bridge-hub-router` to be usable in the chain of
routers when a `NotApplicable` error occurs.

Closes: https://github.com/paritytech/polkadot-sdk/issues/4133

## TODO

- [ ] backport to polkadot-sdk 1.10.0 crates.io release
2024-04-17 09:09:24 +00:00
Alexandru Vasile 8fd839df9d grandpa: Send neighbor packet to lightclients with every finalized head (#4135)
This PR sends the GrandpaNeighbor packet to lightclients similarly to
the full-nodes.

Previously, the lightclient would receive a GrandpaNeigbor packet only
when the note set changed.

Related to: https://github.com/paritytech/polkadot-sdk/issues/4120

Next steps:
-  [ ] check with lightclient

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-17 08:29:08 +00:00
PG Herveou e81322bc3e Contracts verify benchmark block (#4130)
Add verify statement to ensure that benchmarks call do not revert

Also updated
[benchmarks](https://weights.tasty.limo/compare?unit=time&ignore_errors=true&threshold=10&method=asymptotic&repo=polkadot-sdk&old=master&new=pg/verify-benchmarks&path_pattern=substrate%2Fframe%2Fcontracts%2Fsrc%2Fweights.rs)

---------

Co-authored-by: command-bot <>
2024-04-16 23:38:35 +00:00
Muharem 6f3d890ed3 FRAME: Unity Balance Conversion for Different IDs of Native Asset (#3659)
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>
2024-04-16 16:11:14 +00:00
Oliver Tale-Yazdi 753bf2d860 [prdoc] Update docs (#3998)
Updating the prdoc doc file to be a bit more useful for new contributors
and adding a SemVer section.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2024-04-16 15:17:09 +00:00
Maksym H 61d45ed72b Update review-trigger.yml (#4137)
Followup after https://github.com/paritytech/polkadot-sdk/pull/3431
Per
https://stackoverflow.com/questions/63188674/github-actions-detect-author-association
and https://michaelheap.com/github-actions-check-permission/
looks like just checking NOT a MEMBER is not correct, Not a CONTRIBUTORs
check should be included
2024-04-16 10:11:22 +00:00
Javier Bullrich dd5dbf3902 added check to ensure there are approvals (#4152)
Follow up to #3431

Added an api check to verify that there are pre-existing approvals in
the PR before dismissing reviews and posting a message
2024-04-16 10:10:12 +00:00
Oliver Tale-Yazdi 8891b70fe2 [pallet-broker] Use saturating math in input validation (#4151)
Changes:
- Saturate in the input validation of he drop history function or
pallet-broker.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2024-04-16 10:08:26 +00:00
Alin Dima 4b5c3fd0cb move fragment_tree module to its own folder (#4148)
Will make https://github.com/paritytech/polkadot-sdk/pull/4035 easier to
review (the mentioned PR already does this move so the diff will be
clearer).

Also called out as part of:
https://github.com/paritytech/polkadot-sdk/pull/3233#discussion_r1490867383
2024-04-16 07:25:22 +00:00
gui a8f4f4f00f pallet assets: Fix errors (#4118)
`LiveAsset` is an error to be returned when an asset is not supposed to
be live.
And `AssetNotLive` is an error to be returned when an asset is supposed
to be live, I don't think frozen qualifies as live.
2024-04-15 18:45:44 +00:00
Dónal Murray 0c9ad5306c [pallet-broker] add tests for renewing leases (#4099)
The first test proves that parachains who were migrated over on a legacy
lease can renew without downtime.

The exception is if their lease expires in period 0 - aka within
`region_length` timeslices after `start_sales` is called. The second
test is designed such that it passes if the issue exists and should be
fixed.
This will require an intervention on Kusama to add these renewals to
storage as it is too tight to schedule a runtime upgrade before the
start_sales call. All leases will still have at least two full regions
of coretime.
2024-04-15 16:28:33 +00:00
Alexandru Vasile d1f9fe0a99 logging(fix): Use the proper log target for logging (#4124)
This PR ensures the proper logging target (ie `libp2p_tcp` or `beefy`)
is displayed.

The issue has been introduced in:
https://github.com/paritytech/polkadot-sdk/pull/4059, which removes the
normalized metadata of logs.

From
[documentation](https://docs.rs/tracing-log/latest/tracing_log/trait.NormalizeEvent.html#tymethod.normalized_metadata):

> In tracing-log, an Event produced by a log (through
[AsTrace](https://docs.rs/tracing-log/latest/tracing_log/trait.AsTrace.html))
has an hard coded “log” target

>
[normalized_metadata](https://docs.rs/tracing-log/latest/tracing_log/trait.NormalizeEvent.html#tymethod.normalized_metadata):
If this Event comes from a log, this method provides a new normalized
Metadata which has all available attributes from the original log,
including file, line, module_path and target

This has low implications if a version was deployed containing the
mentioned pull request, as we'll lose the ability to distinguish between
log targets.

### Before this PR

```
2024-04-15 12:45:40.327  INFO main log: Parity Polkadot
2024-04-15 12:45:40.328  INFO main log: ✌️  version 1.10.0-d1b0ef76a8b
2024-04-15 12:45:40.328  INFO main log: ❤️  by Parity Technologies <admin@parity.io>, 2017-2024
2024-04-15 12:45:40.328  INFO main log: 📋 Chain specification: Development
2024-04-15 12:45:40.328  INFO main log: 🏷  Node name: yellow-eyes-2963
2024-04-15 12:45:40.328  INFO main log: 👤 Role: AUTHORITY
2024-04-15 12:45:40.328  INFO main log: 💾 Database: RocksDb at /tmp/substrated39i9J/chains/rococo_dev/db/full
2024-04-15 12:45:44.508  WARN main log: Took active validators from set with wrong size
...

2024-04-15 12:45:45.805  INFO                 main log: 👶 Starting BABE Authorship worker
2024-04-15 12:45:45.806  INFO tokio-runtime-worker log: 🥩 BEEFY gadget waiting for BEEFY pallet to become available...
2024-04-15 12:45:45.806 DEBUG tokio-runtime-worker log: New listen address: /ip6/::1/tcp/30333
2024-04-15 12:45:45.806 DEBUG tokio-runtime-worker log: New listen address: /ip4/127.0.0.1/tcp/30333
```

### After this PR

```
2024-04-15 12:59:45.623  INFO main sc_cli:🏃 Parity Polkadot
2024-04-15 12:59:45.623  INFO main sc_cli:🏃 ✌️  version 1.10.0-d1b0ef76a8b
2024-04-15 12:59:45.623  INFO main sc_cli:🏃 ❤️  by Parity Technologies <admin@parity.io>, 2017-2024
2024-04-15 12:59:45.623  INFO main sc_cli:🏃 📋 Chain specification: Development
2024-04-15 12:59:45.623  INFO main sc_cli:🏃 🏷  Node name: helpless-lizards-0550
2024-04-15 12:59:45.623  INFO main sc_cli:🏃 👤 Role: AUTHORITY
...
2024-04-15 12:59:50.204  INFO tokio-runtime-worker beefy: 🥩 BEEFY gadget waiting for BEEFY pallet to become available...
2024-04-15 12:59:50.204 DEBUG tokio-runtime-worker libp2p_tcp: New listen address: /ip6/::1/tcp/30333
2024-04-15 12:59:50.204 DEBUG tokio-runtime-worker libp2p_tcp: New listen address: /ip4/127.0.0.1/tcp/30333
```

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-15 14:33:55 +00:00
Javier Bullrich 8b4cfda758 added script to require a review post push (#3431)
Closes https://github.com/paritytech/opstooling/issues/174

Added a new step in the action that triggers review bot to stop approval
from new pushes.

This step works in the following way:
- If the **author of the PR**, who **is not** a member of the org,
pushed a new commit then:
- Review-Trigger requests new reviews from the reviewers and fails.

It *does not dismiss reviews*. It simply request them again, but they
will still be available.

This way, if the author changed something in the code, they will still
need to have this latest change approved to stop them from uploading
malicious code.

Find the requested issue linked to this PR (it is from a private repo so
I can't link it here)
2024-04-15 13:46:14 +00:00
Bastian Köcher 6f73b746d3 pallet_broker: Support renewing leases expired in a previous period (#4089)
Part of: https://github.com/paritytech/polkadot-sdk/issues/4107
2024-04-15 13:06:22 +00:00
Bastian Köcher d1b0ef76a8 sp-api: Use macro to detect if frame-metadata is enabled (#4117)
While `sp-api-proc-macro` isn't used directly and thus, it should have
the same features enabled as `sp-api`. However, I have seen issues
around `frame-metadata` not being enabled for `sp-api`, but for
`sp-api-proc-macro`. This can be prevented by using the
`frame_metadata_enabled` macro from `sp-api` that ensures we have the
same feature set between both crates.
2024-04-15 08:11:51 +00:00
Svyatoslav Nikolsky 6acf4787e1 Bridge: slash destination may be an explicit account (#4106)
Extracted to a separate PR as requested here:
https://github.com/paritytech/parity-bridges-common/pull/2873#discussion_r1562459573
2024-04-15 06:37:04 +00:00
Alexandru Gheorghe 2bc4ed1153 Prevent accidental change of network-key for active authorities (#3852)
As discovered during investigation of
https://github.com/paritytech/polkadot-sdk/issues/3314 and
https://github.com/paritytech/polkadot-sdk/issues/3673 there are active
validators which accidentally might change their network key during
restart, that's not a safe operation when you are in the active set
because of distributed nature of DHT, so the old records would still
exist in the network until they expire 36h, so unless they have a good
reason validators should avoid changing their key when they restart
their nodes.

There is an effort in parallel to improve this situation
https://github.com/paritytech/polkadot-sdk/pull/3786, but those changes
are way more intrusive and will need more rigorous testing, additionally
they will reduce the time to less than 36h, but the propagation won't be
instant anyway, so not changing your network during restart should be
the safest way to run your node, unless you have a really good reason to
change it.

## Proposal
1. Do not auto-generate the network if the network file does not exist
in the provided path. Nodes where the key file does not exist will get
the following error:
```
Error: 
   0: Starting an authorithy without network key in /home/alexggh/.local/share/polkadot/chains/ksmcc3/network/secret_ed25519.
      
       This is not a safe operation because the old identity still lives in the dht for 36 hours.
      
       Because of it your node might suffer from not being properly connected to other nodes for validation purposes.
      
       If it is the first time running your node you could use one of the following methods.
      
       1. Pass --unsafe-force-node-key-generation and make sure you remove it for subsequent node restarts
      
       2. Separetly generate the key with: polkadot key generate-node-key --file <YOUR_PATH_TO_NODE_KEY>
```

2. Add an explicit parameters for nodes that do want to change their
network despite the warnings or if they run the node for the first time.
`--unsafe-force-node-key-generation`

3. For `polkadot key generate-node-key` add two new mutually exclusive
parameters `base_path` and `default_base_path` to help with the key
generation in the same path the polkadot main command would expect it.
 
4. Modify the installation scripts to auto-generate a key in default
path if one was not present already there, this should help with making
the executable work out of the box after an instalation.

## Notes

Nodes that do not have already the key persisted will fail to start
after this change, however I do consider that better than the current
situation where they start but they silently hide that they might not be
properly connected to their peers.

## TODO
- [x] Make sure only nodes that are authorities on producation chains
will be affected by this restrictions.
- [x] Proper PRDOC, to make sure node operators are aware this is
coming.

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
2024-04-15 06:23:35 +00:00
Bastian Köcher 88fe94516c rococo_contracts: Adds missing migration (#4112)
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
2024-04-14 20:39:40 +00:00
Jonathan Udd 6688eac5ab Adding Dwellir bootnodes for Coretime Westend, People Westend and Paseo (#4066)
Verified by running a node using `--reserved-only` and
`--reserved-nodes`.
2024-04-14 13:23:00 +00:00
Oliver Tale-Yazdi 30c58fa22a Deploy pallet-parameters to rococo and fix dynamic_params name expand (#4006)
Changes:
- Add pallet-parameters to Rococo to configure the NIS and preimage
pallet.
- Fix names of expanded dynamic params. Apparently, `to_class_case`
removes suffix `s`, and `Nis` becomes `Ni` 😑. Now using
`to_pascal_case`.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Alessandro Siniscalchi <asiniscalchi@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: command-bot <>
2024-04-13 11:20:42 +00:00
Przemek Rzad 1bca825cc2 Use master environment in the synchronize templates workflow (#4114) 2024-04-13 15:00:45 +04:00
Przemek Rzad aa43797437 Use Github Issue Sync to automate issues in Parachain board (#3694)
This workflow will automatically add issues related to async backing to
the Parachain team board, updating a custom "meta" field.

Requested by @the-right-joyce
2024-04-13 09:33:37 +00:00
Bastian Köcher 7c698502d1 sc_network_test: Announce only the highest block (#4111)
Closes: https://github.com/paritytech/polkadot-sdk/issues/4100
2024-04-13 08:40:10 +00:00
Serban Iorga 8220c98008 Fix zombienet-bridges-0001-asset-transfer-works (#4069)
Fixes https://github.com/paritytech/polkadot-sdk/issues/3999

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
2024-04-13 07:04:26 +00:00
Vedhavyas Singareddi 5b513cc0e9 define block hash provider and default impl using frame_system (#4080)
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
2024-04-12 21:57:05 +00:00
Branislav Kontur 5601f2865b Remove xcm::v3 from assets-common nits (#4037)
This PR mainly removes `xcm::v3` stuff from `assets-common` to make it
more generic and facilitate the transition to newer XCM versions. Some
of the implementations here used hard-coded `xcm::v3::Location`, but now
it's up to the runtime to configure according to its needs.

Additional/consequent changes:
- `penpal` runtime uses now `xcm::latest::Location` for `pallet_assets`
as `AssetId`, because we don't care about migrations here
- it pretty much simplify xcm-emulator integration tests, where we don't
need now a lots of boilerplate conversions:
      ```
      v3::Location::try_from(...).expect("conversion works")`
      ```
- xcm-emulator tests
- split macro `impl_assets_helpers_for_parachain` to the
`impl_assets_helpers_for_parachain` and
`impl_foreign_assets_helpers_for_parachain` (avoids using hard-coded
`xcm::v3::Location`)
2024-04-12 21:24:09 +00:00
Squirrel b28ba4ae96 Remove redundent logging code (#4059)
1. The `CustomFmtContext::ContextWithFormatFields` enum arm isn't
actually used and thus we don't need the enum anymore.

2. We don't do anything with most of the normalized metadata that's
created by calling `event.normalized_metadata();` - the `target` we can
get from `event.metadata.target()` and level we can get from
`event.metadata.level()` - let's just call them direct to simplify
things. (`event.metadata()` is just a field call under the hood)

Changelog: No functional changes, might run a tad faster with lots of
logging turned on.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2024-04-12 21:18:48 +00:00
Przemek Rzad c963dc283a Synchronize templates (#4040)
- Progresses https://github.com/paritytech/polkadot-sdk/issues/3155

### What's inside

A job, that will take each of the three
[templates](https://github.com/paritytech/polkadot-sdk/tree/master/templates),
yank them out of the monorepo workspace, and push to individual
repositories
([1](https://github.com/paritytech/polkadot-sdk-minimal-template),
[2](https://github.com/paritytech/polkadot-sdk-parachain-template),
[3](https://github.com/paritytech/polkadot-sdk-solochain-template)).

In case the build/test does not succeed, a PR such as [this
one](https://github.com/paritytech-stg/polkadot-sdk-solochain-template/pull/2)
gets created instead.

I'm proposing a manual dispatch trigger for now - so we can test and
iterate faster - and change it to fully automatic triggered by releases
later.

The manual trigger looks like this:

<img width="340px"
src="https://github.com/paritytech/polkadot-sdk/assets/12039224/e87e0fda-23a3-4735-9035-af801e8417fc"/>

### How it works

The job replaces dependencies [referenced by
git](https://github.com/paritytech/polkadot-sdk/blob/d733c77ee2d2e8e2d5205c552a5efb2e5b5242c8/templates/minimal/pallets/template/Cargo.toml#L25)
with a reference to released crates using
[psvm](https://github.com/paritytech/psvm).

It creates a new workspace for the template, and adapts what's needed
from the `polkadot-sdk` workspace.

### See the results

The action has been tried out in staging, and the results can be
observed here:

- [minimal
stg](https://github.com/paritytech-stg/polkadot-sdk-minimal-template/)
- [parachain
stg](https://github.com/paritytech-stg/polkadot-sdk-parachain-template/)
- [solochain
stg](https://github.com/paritytech-stg/polkadot-sdk-solochain-template/)

These are based on the `1.9.0` release (using `release-crates-io-v1.9.0`
branch).
2024-04-12 17:24:35 +00:00
wersfeds 480d5d0fea chore: fix some typos (#4095) 2024-04-12 14:32:23 +00:00
Adrian Catangiu 1e971b8d2a pallet-xcm: add new extrinsic for asset transfers using explicit XCM transfer types (#3695)
# Description

Add `transfer_assets_using()` for transferring assets from local chain
to destination chain using explicit XCM transfer types such as:
- `TransferType::LocalReserve`: transfer assets to sovereign account of
destination chain and forward a notification XCM to `dest` to mint and
deposit reserve-based assets to `beneficiary`.
- `TransferType::DestinationReserve`: burn local assets and forward a
notification to `dest` chain to withdraw the reserve assets from this
chain's sovereign account and deposit them to `beneficiary`.
- `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM
to `reserve` chain to move reserves from this chain's SA to `dest`
chain's SA, and forward another XCM to `dest` to mint and deposit
reserve-based assets to `beneficiary`. Typically the remote `reserve` is
Asset Hub.
- `TransferType::Teleport`: burn local assets and forward XCM to `dest`
chain to mint/teleport assets and deposit them to `beneficiary`.

By default, an asset's reserve is its origin chain. But sometimes we may
want to explicitly use another chain as reserve (as long as allowed by
runtime `IsReserve` filter).

This is very helpful for transferring assets with multiple configured
reserves (such as Asset Hub ForeignAssets), when the transfer strictly
depends on the used reserve.

E.g. For transferring Foreign Assets over a bridge, Asset Hub must be
used as the reserve location.

# Example usage scenarios

## Transfer bridged ethereum ERC20-tokenX between ecosystem parachains.

ERC20-tokenX is registered on AssetHub as a ForeignAsset by the
Polkadot<>Ethereum bridge (Snowbridge). Its asset_id is something like
`(parents:2, (GlobalConsensus(Ethereum), Address(tokenX_contract)))`.
Its _original_ reserve is Ethereum (only we can't use Ethereum as a
reserve in local transfers); but, since tokenX is also registered on
AssetHub as a ForeignAsset, we can use AssetHub as a reserve.

With this PR we can transfer tokenX from ParaA to ParaB while using
AssetHub as a reserve.

## Transfer AssetHub ForeignAssets between parachains

AssetA created on ParaA but also registered as foreign asset on Asset
Hub. Can use AssetHub as a reserve.

And all of the above can be done while still controlling transfer type
for `fees` so mixing assets in same transfer is supported.

# Tests

Added integration tests for showcasing:
- transferring local (not bridged) assets from parachain over bridge
using local Asset Hub reserve,
- transferring foreign assets from parachain to Asset Hub,
- transferring foreign assets from Asset Hub to parachain,
- transferring foreign assets from parachain to parachain using local
Asset Hub reserve.

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: command-bot <>
2024-04-12 13:53:12 +00:00
Andrei Sandu 2dfe5f745c Runtime API: introduce candidates_pending_availability (#4027)
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>
2024-04-12 10:50:13 +00:00
Svyatoslav Nikolsky a1cb2a5123 Move bridge extensions to a separate folder (#4096)
As requested in
https://github.com/paritytech/parity-bridges-common/pull/2873#discussion_r1558974215
2024-04-12 10:42:30 +00:00
eskimor a64009ae00 Improve docs of broker pallet (#3980)
Small adjustments which should make understanding what is going on much
easier for future readers.

Initialization is a bit messy, the very least we should do is adding
documentation to make it harder to use wrongly.

I was thinking about calling `request_core_count` right from
`start_sales`, but as explained in the docs, this is not necessarily
what you want.

---------

Co-authored-by: eskimor <eskimor@no-such-url.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Dónal Murray <donal.murray@parity.io>
2024-04-12 10:23:49 +00:00
Xiliang Chen b1db5f3a90 establish_channel_with_system (#3721)
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>
2024-04-12 10:14:20 +00:00
Andrei Sandu 13ca339e4a Adjust zombienet test resources and logic (#4032)
One more try to make this test robust from a resource perspective.

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Co-authored-by: Javier Viola <javier@parity.io>
2024-04-12 10:08:34 +00:00
PG Herveou 033484c3ba Use defaultConfig for pallet_contracts (#1817) 2024-04-12 09:35:17 +00:00
Liam Aharon 39b1f50f1c Remove deprecated TryRuntime subcommand (#4017)
Completes the removal of `try-runtime-cli` logic from `polkadot-sdk`.
2024-04-11 20:01:16 +00:00
Andrei Eres 25f038aa8e Run subsystem-benchmark without network latency (#4068)
Implements the idea from
https://github.com/paritytech/polkadot-sdk/pull/3899
- Removed latencies
- Number of runs reduced from 50 to 5, according to local runs it's
quite enough
- Network message is always sent in a spawned task, even if latency is
zero. Without it, CPU time sometimes spikes.
- Removed the `testnet` profile because we probably don't need that
debug additions.

After the local tests I can't say that it brings a significant
improvement in the stability of the results. However, I belive it is
worth trying and looking at the results over time.
2024-04-11 16:54:59 +00:00
Alexander Samusev 6ebf491b50 [ci] Divide subsystem-regression-tests into 2 jobs (#4076)
Currently `subsystem-regression-tests` job fails if the first benchmarks
fail and there is no result for the second benchmark. Also dividing the
job makes the pipeline faster (currently it's a longest job)

cc https://github.com/paritytech/ci_cd/issues/969
cc @AndreiEres

---------

Co-authored-by: Andrei Eres <eresav@me.com>
2024-04-11 15:29:00 +00:00
s0me0ne-unkn0wn f13408d57f Enable mainnet system parachains to use async backing-enabled collator (#3630)
This is phase 2 of async backing enablement for the system parachains on
the production networks. ~~It should be merged after
polkadot-fellows/runtimes#228 is enacted. After it is released,~~ all
the system parachain collators should be upgraded, and then we can
proceed with phase 3, which will enable async backing in the runtimes.

UPDATE: Indeed, we don't need to wait for the runtime upgrade enactions.
The lookahead collator handles the transition by itself, so we can
upgrade ASAP.

## Scope of changes

Here, we eliminate the dichotomy of having "generic Aura collators" for
the production system parachains and "lookahead Aura collators" for the
testnet system parachains. Now, all the collators are started as
lookahead ones, preserving the logic of transferring from the shell node
to Aura-enabled collators for the asset hubs. So, indeed, it simplifies
the parachain service logic, which cannot but rejoice.
2024-04-11 14:58:56 +00:00
Oliver Tale-Yazdi 832570545b Fix link check (#4074)
Closes #4041

Changes:
- Increase cache size and reduce retries.
- Ignore Substrate SE links :(
- Fix broken link.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2024-04-11 10:55:42 +00:00
Andrei Sandu 9ede4152ef collation-generation: Avoid using para_backing_state if runtime is ancient (#4070)
fixes https://github.com/paritytech/polkadot-sdk/issues/4067

Also add an early bail out for look ahead collator such that we don't
waste time if a CollatorFn is not set.

TODO:
- [x] add test.
- [x] Polkadot System Parachain burn-in.

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
2024-04-11 10:36:30 +00:00
Andrei Sandu 69cc7f2090 Fix ClaimQueue case of nothing scheduled on session boundary (#4065)
Same issue but about av-cores was fixed in
https://github.com/paritytech/polkadot-sdk/pull/1403

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
2024-04-11 08:37:12 +00:00
PG Herveou 643aa2be2a Contracts: Remove ED from base deposit (#3536)
- Update internal logic so that the storage_base_deposit does not
include ED
- add v16 migration to update ContractInfo struct with this change

Before:
<img width="820" alt="Screenshot 2024-03-21 at 11 23 29"
src="https://github.com/paritytech/polkadot-sdk/assets/521091/a0a8df0d-e743-42c5-9e16-cf2ec1aa949c">

After:
![Screenshot 2024-03-21 at 11 23
42](https://github.com/paritytech/polkadot-sdk/assets/521091/593235b0-b866-4915-b653-2071d793228b)

---------

Co-authored-by: Cyrill Leutwiler <cyrill@parity.io>
Co-authored-by: command-bot <>
2024-04-10 20:32:53 +00:00
Milos Kriz d21a41f238 Amend chainspecs for people-westend and add IBP bootnodes (#4072)
Dear team, dear @NachoPal @joepetrowski @bkchr @ggwpez,

This is a retry of #3957, after merging master as advised!,

Many thanks!

**_Milos_**

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2024-04-10 19:31:31 +00:00
PG Herveou 1da8d12dd1 Contracts: Reuse module when validating (#3789)
Reuse wasmi Module when validating.
Prepare the code for 0.32 and the addition of Module::new_unchecked
2024-04-10 18:56:51 +00:00
Alexandru Vasile cd010925e1 net/strategy: Log bad peerId from on_validated_block_announce (#4051)
This tiny PR extends the `on_validated_block_announce` log with the bad
PeerID.
Used to identify if the peerID is malicious by correlating with other
logs (ie peer-set).

While at it, have removed the `\n` from a multiline log, which did not
play well with
[sub-triage-logs](https://github.com/lexnv/sub-triage-logs/tree/master).

cc @paritytech/networking

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
2024-04-10 15:29:36 +00:00