Commit Graph

14581 Commits

Author SHA1 Message Date
Francisco Aguirre f0d443a055 Remove some dbgs (#1949)
Removed some debug logs
2023-10-20 11:08:25 +02:00
cheme f4c4c0fe29 Switch trie cache random seed (#1935)
Use a more secure seed for hashsets of cache.
2023-10-20 12:13:19 +09:00
Sebastian Kunert e1e0381380 Expose prometheus metrics for minimal-relay-chain node in collators (#1942)
Until now prometheus metrics were not exposed by the minimal relay chain
node.
Also slight cleanups.
2023-10-20 00:47:54 +02:00
Bastian Köcher b967ba53d3 Do not force collators to update after enabling async backing (#1920)
The validators are checking if async backing is enabled by checking the
version of the runtime api. If the runtime api is upgraded by a runtime
upgrade, the validators start to also enable the async backing logic.
However, just because async backing is enabled, it doesn't mean that all
collators and parachain runtimes have upgraded. This pull request fixes
an issue about advertising collations to the relay chain when it has
async backing enabled, but the collator is still using the old
networking protocol. The implementation is actually backwards compatible
as we can not expect that everyone directly upgrades. However, the
collation advertisement logic was requiring V2 networking messages after
async backing was enabled, which was wrong. This is now fixed by this
pull request.

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

---------

Co-authored-by: eskimor <eskimor@users.noreply.github.com>
2023-10-19 21:45:33 +02:00
Chevdor 961a8fd77e Pin PRDoc image to v0.0.5 until we are ready for v0.0.6 (#1947)
This PR prevents failures until #1946 is merged.
2023-10-19 19:26:09 +02:00
Serban Iorga 18ae22483b [prdoc] Start BEEFY gadget by default for Polkadot nodes (#1945)
Just adding a prdoc for
https://github.com/paritytech/polkadot-sdk/pull/1913

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
2023-10-19 16:52:04 +03:00
Branislav Kontur 68d2363701 Update bridges subtree (#1944) 2023-10-19 16:30:17 +03:00
Javier Viola 3706a75f37 bump zombienet version (#1931)
Includes:
-  PoC for new `spot instance` infra for jobs.
- Fixes in test-runner/cli
2023-10-19 08:22:40 -03:00
Oliver Tale-Yazdi 099ef8fe11 [FRAME] Message Queue use proper overweight limit (#1873)
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 <oliver.tale-yazdi@parity.io>
2023-10-19 12:02:13 +02:00
Sebastian Kunert 21b32849db Cumulus: Allow aura to use initialized collation request receiver (#1911)
When launching our [small
network](https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/zombienet/examples/small_network.toml)
for testing the node was crashing here shortly after launch:

https://github.com/paritytech/polkadot-sdk/blob/5cdd819ed295645958afd9d937d989978fd0c84e/polkadot/node/collation-generation/src/lib.rs#L140

After changes in #1788 for the asset hub collator we are waiting for
blocks of the shell runtime to pass before we initialize aura. However,
this means that we attempted to initialize the collation related relay
chain subsystems twice, leading to the error.

I modified Aura to let it optionally take an already initialized stream
of collation requests.
2023-10-19 10:07:29 +02:00
Liam Aharon 411a4e38d3 Use prebuilt try-runtime binary in CI (#1898)
`cargo install` takes a long time in CI. We want to run it relatively
frequently without chewing through so much compute (see
https://github.com/paritytech/ci_cd/issues/771) so I added automatic
binary releases to the try-runtime-cli repo.

A small added benefit is we can use it in our existing
`on-runtime-upgrade` checks, which should cut their execution time by
about half.
2023-10-19 12:19:16 +11:00
Bulat Saifullin 3e98021986 Update kusama/polkadot bootnodes (#1895)
closes: https://github.com/paritytech/devops/issues/2090

## Changes
1. Updated the list of bootnodes.
2. Merged the Connect node and bootnode into a single node.
3. Decreased the number of nodes.
4. Updated the DNS name.

## Description
The initial 8 bootnodes were planned to be replaced by community
bootnodes, the community node was added but we did not bother to reduce
the Parity managed bootnodes. Fixing it now.
2023-10-18 20:01:58 +04:00
Keith Yeung 3dece311be Introduce XcmFeesToAccount fee manager (#1234)
Combination of paritytech/polkadot#7005, its addon PR
paritytech/polkadot#7585 and its companion paritytech/cumulus#2433.

This PR introduces a new XcmFeesToAccount struct which implements the
`FeeManager` trait, and assigns this struct as the `FeeManager` in the
XCM config for all runtimes.

The struct simply deposits all fees handled by the XCM executor to a
specified account. In all runtimes, the specified account is configured
as the treasury account.

XCM __delivery__ fees are now being introduced (unless the root origin
is sending a message to a system parachain on behalf of the originating
chain).

# Note for reviewers

Most file changes are tests that had to be modified to account for the
new fees.
Main changes are in:
- cumulus/pallets/xcmp-queue/src/lib.rs <- To make it track the delivery
fees exponential factor
- polkadot/xcm/xcm-builder/src/fee_handling.rs <- Added. Has the
FeeManager implementation
- All runtime xcm_config files <- To add the FeeManager to the XCM
configuration

# Important note

After this change, instructions that create and send a new XCM (Query*,
Report*, ExportMessage, InitiateReserveWithdraw, InitiateTeleport,
DepositReserveAsset, TransferReserveAsset, LockAsset and RequestUnlock)
will require the corresponding origin account in the origin register to
pay for transport delivery fees, and the onward message will fail to be
sent if the origin account does not have the required amount. This
delivery fee is on top of what we already collect as tx fees in
pallet-xcm and XCM BuyExecution fees!

Wallet UIs that want to expose the new delivery fee can do so using the
formula:

```
delivery_fee_factor * (base_fee + encoded_msg_len * per_byte_fee)
```

where the delivery fee factor can be obtained from the corresponding
pallet based on which transport you are using (UMP, HRMP or bridges),
the base fee is a constant, the encoded message length from the message
itself and the per byte fee is the same as the configured per byte fee
for txs (i.e. `TransactionByteFee`).

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Giles Cope <gilescope@gmail.com>
Co-authored-by: command-bot <>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2023-10-18 17:22:25 +02:00
Javier Bullrich 1cf7d3aafa upgraded review bot to v2.1.0 (#1908)
Upgraded to version 2.1.0 which has paritytech/review-bot#94, a change
in the logic of the action to overcome some problems with permissions
coming from PRs from forks

For this, we needed to divide the actions into two files:
- A first action that triggers on PRs and reviews and uploads the PR
number.
- A second action which is triggered under the completion of the first
one and runs as the action normally runs (but won't have any problems
regarding permissions because it is triggered from the master branch)
2023-10-18 14:04:39 +02:00
Alex Bean 3aaf62add4 Trading trait and deal with metadata in Mutate trait for nonfungibles_v2 (#1561)
I have added some Traits that are missing and are useful for dealing
with non-fungible tokens on other pallets and their implementations for
NFTs pallet.

- In the Mutate trait, added methods for dealing with the metadata:
`set_metadata`, `set_collection_metadata`, `clear_metadata` and
`clear_collection_metadata`.
The motivation of adding this methods coming from a StackExchange
question asking for it: [Setting metadata of an item of the Nfts pallet
in a custom
pallet](https://substrate.stackexchange.com/questions/9974/setting-metadata-of-an-item-of-the-nfts-pallet-in-a-custom-pallet)

- A Trait for trading non-fungible items. The methods in that Trait are
`buy_item`, `set_price` and `item_price`
An example of where this Trait can be useful is a pallet that deals with
[NFT
Royalties](https://forum.polkadot.network/t/nfts-royalty-pallet/3766)
and needs to perform this actions.

---------

Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com>
2023-10-18 13:33:29 +03:00
joe petrowski d3ea69b7ac Add Runtime Missing Crate Descriptions (#1909)
Adds descriptions needed for publishing to crates.io.
2023-10-18 10:56:03 +02:00
Chevdor b665409462 Switch to the release env (#1910)
Follow up of #1892, this PR now switches the env for release related
workflows from `master` to `release`.
2023-10-18 10:14:33 +02:00
dependabot[bot] 9c333a5c2f Bump paritytech/review-bot from 2.0.1 to 2.1.0 (#1924)
Bumps [paritytech/review-bot](https://github.com/paritytech/review-bot) from 2.0.1 to 2.1.0.
2023-10-18 09:40:21 +02:00
dependabot[bot] e34aa4b78e Bump actions/checkout from 4.1.0 to 4.1.1 (#1925)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.0 to 4.1.1.
2023-10-18 09:39:57 +02:00
Serban Iorga 6c39bb4a61 Start BEEFY client by default for Polkadot nodes (#1913)
Fellowship companion:
https://github.com/polkadot-fellows/runtimes/pull/65

This starts the BEEFY client by default for Polkadot nodes.

Governance/sudo call is later required to enable/start consensus.

Part of https://github.com/paritytech/parity-bridges-common/issues/2420
2023-10-18 09:36:26 +02:00
Adrian Catangiu 8b3905d2a5 cumulus: add asset-hub-rococo runtime based on asset-hub-kusama and add asset-bridging support to it (#1215)
This commit adds Rococo Asset Hub dedicated runtime so we can test new
features here, before merging them in Kusama Asset Hub.
Also adds one such feature: asset transfer over bridge (Rococo AssetHub
<> Wococo AssetHub)

- clone `asset-hub-kusama-runtime` -> `asset-hub-rococo-runtime`
- make it use Rococo primitives, names, assets, constants, etc
- add asset-transfer-over-bridge support to Rococo AssetHub <> Wococo
AssetHub

Fixes #1128

---------

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
2023-10-18 08:47:45 +02:00
Ignacio Palacios e73729b15f Publish penpal-runtime crate (#1904)
Remove `publish = false` to publish the crate
2023-10-18 12:17:23 +05:30
Adrian Catangiu 024fce70f4 bridges: add missing crate descriptions (#1919)
Adds descriptions needed for publishing bridges crates to crates.io.

see https://forum.parity.io/t/crates-need-descriptions/2115

Signed-off-by: Adrian Catangiu <adrian@parity.io>
2023-10-18 01:36:53 +02:00
Oliver Tale-Yazdi 58b7927284 Fix para-scheduler migration on Rococo (#1921)
Closes https://github.com/paritytech/polkadot-sdk/issues/1916

Changes:
- Trivially wrap the migration into a version migration to enforce
idempotency.
- Opinionated logging nits

@liamaharon maybe we can add a check to the `try-runtime-cli` that
migrations are idempotent? It should be possible to check that the
storage root is identical after executing a second time (and that it
does not panic like it did here 😆).

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
2023-10-18 00:19:34 +02:00
Xiliang Chen 38c0604b46 increase MAX_ASSETS_FOR_BUY_EXECUTION (#1733)
Partially addresses #1638

Still need a better solution to allow devs to have better control of
this.

---------

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
2023-10-17 16:47:48 +02:00
Marcin S a1171e6e81 PVF worker: Maintain lists of used syscalls (#1663)
Co-authored-by: Mira Ressel <mira@parity.io>
2023-10-17 13:58:49 +02:00
Mira Ressel b14018fe48 ci: remove obsolete allow_failure annotations (#1886)
These two jobs are now required by github branch protection settings.
2023-10-17 13:22:02 +03:00
Squirrel d9e266f432 nit: use traits::tokens::fungible => use traits::fungible (#1753)
Slightly less verbose use of fungible(s).

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
2023-10-17 11:55:59 +02:00
Branislav Kontur 5cdd819ed2 [xcm] Small enhancements for NetworkExportTable and xcm-builder (#1848)
## Summary

This PR introduces several enhancements.

The current implementation of `NetworkExportTable` lacks remote location
filtering support beyond `NetworkId` lookup. To provide more control and
granularity, it's essential to allow configuration for bridging to
different consensus `NetworkId` while restricting access e.g. to
particular remote parachains.

Additionally, the `StartsWith` and `Equals` and
`StartsWithExplicitGlobalConsensus` helper functions, which are in
active use, are moved to the `xcm-builder` and `frame_support` modules
for better code organization.

Adds a new `LocationWithAssetFilters` filter to enable location-based
and asset-related filtering. This filter is useful for configuring the
`pallet_xcm` filter for
[XcmTeleportFilter](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/lib.rs#L212)
and
[XcmReserveTransferFilter](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/pallet-xcm/src/lib.rs#L216)
to restrict specific assets.

Furthermore, the `BridgeMessage` fields are not accessible outside of
`xcm-builder`, limiting the ability to create custom logic dependent on
it.

---------

Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
2023-10-17 11:11:03 +02:00
Kian Paimani e10de2e283 cleanup a few hidden imports in frame-support (#1770)
Just making a few hidden imports cleaner and hidden in docs.

---------

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2023-10-17 10:09:03 +02:00
Liam Aharon fcc1bb414b Allow Locks/Holds/Reserves/Freezes by default when using pallet_balances TestDefaultConfig (#1880)
Allow Locks/Holds/Reserves/Freezes by default when using
`pallet_balances` `TestDefaultConfig`.
2023-10-17 08:06:03 +11:00
Oliver Tale-Yazdi 9c1a2b38e5 Workspace maintenance (#1884)
Changes:
- Add missing crate to the workspace
- Remove versions from local dependency links

Maybe it is finally worth it to add this scrip to the CI to find these
things earlier:
[check-deps.py](https://github.com/ggwpez/substrate-scripts/blob/master/import-runtime-repos/check-deps.py).

@paritytech/ci what would be the best location for that check?  
It takes only a second to run, so maybe we can squeeze it into one of
the existing checks?
Otherwise creating a new GH workflow feels a bit wasteful... maybe i can
group it with https://github.com/paritytech/polkadot-sdk/pull/1831

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-10-16 20:03:53 +02:00
Ignacio Palacios e0065cb81b Make System Parachains trusted Teleporters (#1368)
Make System Parachain trusted Teleporters of each other.

Migration of https://github.com/paritytech/cumulus/pull/2842

---------

Co-authored-by: command-bot <>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
2023-10-16 19:52:33 +02:00
Chevdor 4145902f1c Add missing env (#1892)
This PR adds a missing env to allow publishing the Docker image.
2023-10-16 18:53:08 +02:00
Muharem c422e3f577 extract amount method for fungible/s Imbalance (#1847)
Introduces an `extract` amount method for `fungible/s` `Imbalance`.
2023-10-16 17:16:59 +02:00
Adrian Catangiu 646ecd0edb sc-consensus-beefy: fix initialization when state is unavailable (#1888)
Fix situation where BEEFY initial validator set could not be determined.

If state is unavailable at BEEFY genesis block to get initial validator
set, get the info from header digests. For this, we need to walk back
the chain starting from BEEFY genesis looking for the BEEFY digest
announcing the active validator set for that respective session.

This commit fixes a silly bug where walking back the chain was stopped
when reaching BEEFY genesis block, which is incorrect when BEEFY genesis
is not session boundary block. When BEEFY genesis is set to some random
block within a session, we need to walk back to the start of the session
to see the validator set announcement.

Added regression test for this fix.

Fixes https://github.com/paritytech/polkadot-sdk/issues/1885

Signed-off-by: Adrian Catangiu <adrian@parity.io>
2023-10-16 17:35:42 +03:00
Bastian Köcher 4e98bec3f1 sp-api: Improve error message for duplicate runtime apis (#1877)
Co-authored-by: command-bot <>
2023-10-16 14:41:44 +02:00
Oliver Tale-Yazdi e0e566bc2e [CI] Add link checker (#1875)
Adding link checker to the CI (closes
https://github.com/paritytech/polkadot-sdk/issues/993). It would be nice
to have the docs people own this and extend accordingly.
Currently all known-bad links are excluded, but we should one-by-one
include those as well until all are fixed.

This check now ensures that 1) no new broken links are introduced into
`.rs` files and 2) that no old links break unnoticed.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-10-16 14:19:45 +02:00
Bulat Saifullin 73ec161ebc Update the alerts to use a new metric substrate_unbounded_channel_size (#1568)
# Description

Follow up for https://github.com/paritytech/polkadot-sdk/pull/1489.
Closes #611 

Before we calculated the channel size during alert expression but in
#1489 a new metric was introduced that reports channel size.
## Changes:
1. updated alert rule to use new metric.
2023-10-16 13:15:50 +02:00
Ignacio Palacios 8f1f2f35ba Publish xcm-emulator crate (#1881)
Remove `publish = false` to publish the crate
2023-10-16 11:09:46 +02:00
Alejandro Martinez Andres 86fde367c0 Adding migrations to clean Rococo Gov 1 storage & reserved funds (#1849)
Following
[polkadot#7314](https://github.com/paritytech/polkadot/pull/7314) and
after merging https://github.com/paritytech/polkadot-sdk/pull/1177 this
PR solves https://github.com/paritytech/polkadot-sdk/issues/1618

The following is a summary of the outcome of the migration.

| Module | Total Accounts | Total stake to unlock | Total deposit to
unreserve |
| ------- | --------------- | --------------------- |
-------------------------- |
| Elections Phragmen | 27 | 1,132.821063320441 ROC | 1.465386531600 ROC
|
| Democracy | 69 | 2733.923509345613 ROC | 0.166666665000 ROC |
| Tips | 4 | N/A | 0.015099999849 ROC |

The migrations will also remove the following amount of keys

103 Democracy keys 🧹
5 Council keys 🧹
1 TechnicalCommittee keys 🧹
25 PhragmenElection keys 🧹
1 TechnicalMembership keys 🧹
9 Tips keys 🧹
2023-10-16 10:47:20 +02:00
Davide Galassi 38ef04eb53 Arkworks Elliptic Curve utils overhaul (#1870)
- Removal of Arkworks unit tests. These tests were just testing the
arkworks upstream implementation which should be assumed correct. This
is not the place to test well known dependencies.
- Removal of some over-engineering. We just store the calls to Arkworks
in one file. Per-curve sources are not required.
- Docs formatting

---

I also took the opportunity to bump the `bandersnatch-vrfs` crate
revision internally providing some new shiny stuff.
2023-10-16 10:43:52 +02:00
shuoer86 19f38ca3aa Fix typos (#1878) 2023-10-16 10:01:01 +02:00
Daan van der Plas 91c4360c3c fix: GoAhead signal only set when runtime upgrade is enacted from parachain side (#1176)
The runtime code of a parachain can be replaced on the relay-chain via:

[cumulus]:
[enact_authorized_upgrade](https://github.com/paritytech/polkadot-sdk/blob/1a38d6d6be42b30e8be3ffccec75a4ec995fef9d/cumulus/pallets/parachain-system/src/lib.rs#L661);
this is used for a runtime upgrade when a parachain is not bricked.

[polkadot] (these are used when a parachain is bricked):
-
[force_set_current_code](https://github.com/paritytech/polkadot-sdk/blob/1a38d6d6be42b30e8be3ffccec75a4ec995fef9d/polkadot/runtime/parachains/src/paras/mod.rs#L823):
immediately changes the runtime code of a given para without a pvf check
(root).
-
[force_schedule_code_upgrade](https://github.com/paritytech/polkadot-sdk/blob/1a38d6d6be42b30e8be3ffccec75a4ec995fef9d/polkadot/runtime/parachains/src/paras/mod.rs#L864):
schedules a change to the runtime code of a given para including a pvf
check of the new code (root).
-
[schedule_code_upgrade](https://github.com/paritytech/polkadot-sdk/blob/1a38d6d6be42b30e8be3ffccec75a4ec995fef9d/polkadot/runtime/common/src/paras_registrar.rs#L395):
schedules a change to the runtime code of a given para including a pvf
check of the new code. Besides root, the parachain or parachain manager
can call this extrinsic given that the parachain is unlocked.

Polkadot signals a parachain to be ready for a runtime upgrade through
the
[GoAhead](https://github.com/paritytech/polkadot-sdk/blob/e49493442a9377be9344c06a4990e17423783d41/polkadot/primitives/src/v5/mod.rs#L1229)
signal.

When in cumulus `enact_authorized_upgrade` is executed, the same
underlying helper function of `force_schedule_code_upgrade` &
`schedule_code_upgrade`:
[schedule_code_upgrade](https://github.com/paritytech/polkadot/blob/09b61286da11921a3dda0a8e4015ceb9ef9cffca/runtime/parachains/src/paras/mod.rs#L1778),
is called on the relay-chain, which sets the `GoAhead` signal (if the
pvf is accepted).

If Cumulus receives the `GoAhead` signal from polkadot without having
the `PendingValidationCode` ready, it will panic
([ref](https://github.com/paritytech/polkadot/pull/7412)). For
`enact_authorized_upgrade` we know for sure the `PendingValidationCode`
is set. On the contrary, for `force_schedule_code_upgrade` &
`schedule_code_upgrade` this is not the case.

This PR includes a flag such that the `GoAhead` signal will only be set
when a runtime upgrade is enacted by the parachain
(`enact_authorized_upgrade`).

additional info: https://github.com/paritytech/polkadot/pull/7412

Closes #641

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Bastian Köcher <info@kchr.de>
2023-10-15 23:32:25 +02:00
Gonçalo Pestana 8ee4042c3b Refactor staking ledger (#1484)
This PR refactors the staking ledger logic to encapsulate all reads and
mutations of `Ledger`, `Bonded`, `Payee` and stake locks within the
`StakingLedger` struct implementation.

With these changes, all the reads and mutations to the `Ledger`, `Payee`
and `Bonded` storage map should be done through the methods exposed by
StakingLedger to ensure the data and lock consistency of the operations.
The new introduced methods that mutate and read Ledger are:

- `ledger.update()`: inserts/updates a staking ledger in storage;
updates staking locks accordingly (and ledger.bond(), which is synthatic
sugar for ledger.update())
- `ledger.kill()`: removes all Bonded and StakingLedger related data for
a given ledger; updates staking locks accordingly;
`StakingLedger::get(account)`: queries both the `Bonded` and `Ledger`
storages and returns a `Option<StakingLedger>`. The pallet impl exposes
fn ledger(account) as synthatic sugar for `StakingLedger::get(account)`.

Retrieving a ledger with `StakingLedger::get()` can be done by providing
either a stash or controller account. The input must be wrapped in a
`StakingAccount` variant (Stash or Controller) which is treated
accordingly. This simplifies the caller API but will eventually be
deprecated once we completely get rid of the controller account in
staking. However, this refactor will help with the work necessary when
completely removing the controller.

Other goals:

- No logical changes have been introduced in this PR;
- No breaking changes or updates in wallets required;
- No new storage items or need to perform storage migrations;
- Centralise the changes to bonds and ledger updates to simplify the
OnStakingUpdate updates to the target list (related to
https://github.com/paritytech/polkadot-sdk/issues/443)

Note: it would be great to prevent or at least raise a warning if
`Ledger<T>`, `Payee<T>` and `Bonded<T>` storage types are accessed
outside the `StakingLedger` implementation. This PR should not get
blocked by that feature, but there's a tracking issue here
https://github.com/paritytech/polkadot-sdk/issues/149

Related and step towards
https://github.com/paritytech/polkadot-sdk/issues/443
2023-10-15 22:50:07 +02:00
drskalman 1b34571c0c Paired-key Crypto Scheme (#1705)
BEEFY needs two cryptographic keys at the same time. Validators should
sign BEEFY payload using both ECDSA and BLS key. The network will gossip
a payload which contains a valid ECDSA key. The prover nodes aggregate
the BLS keys if aggregation fails to verifies the validator which
provided a valid ECDSA signature but an invalid BLS signature is subject
to slashing.

As such BEEFY session should be initiated with both key. Currently there
is no straight forward way of doing so, beside having a session with
RuntimeApp corresponding to a crypto scheme contains both keys.

This pull request implement a generic paired_crypto scheme as well as
implementing it for (ECDSA, BLS) pair.

---------

Co-authored-by: Davide Galassi <davxy@datawok.net>
Co-authored-by: Robert Hambrock <roberthambrock@gmail.com>
2023-10-15 11:42:40 +02:00
Julian Eager 9e1447042b Include polkadot version in artifact path (#1828)
closes #695

Could potentially be helpful to preserving caches when applicable, as
discussed in #685

kusama address: FvpsvV1GQAAbwqX6oyRjemgdKV11QU5bXsMg9xsonD1FLGK
2023-10-15 10:39:03 +02:00
S E R A Y A c9b51cd49c add link to rfc-0001 in broker README (#1862)
# Description
- What does this PR do?
  - link added
- Why are these changes needed?
  - improve docs
- How were these changes implemented and what do they affect?
  - only concerns docs
2023-10-15 10:00:58 +02:00
Julian Eager 9f7656df15 Discard Executor (#1855)
closes #622 

Pros:
* simpler interface, just functions:
`create_runtime_from_artifact_bytes()` and `execute_artifact()`

Cons:
* extra overhead of constructing executor semantics each time

I could make it a combination of
* `create_runtime_config(params)` (such that we could clone the
constructed semantics)
* `create_runtime(blob, config)`
* `execute_artifact(blob, config, params)`

Not sure if it's worth it though.

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-10-14 23:06:00 +02:00
Juan 7c87d61f5a Macros to use path instead of ident (#1474) 2023-10-14 08:26:19 +02:00