Commit Graph

16907 Commits

Author SHA1 Message Date
Svyatoslav Nikolsky 921265ca78 Added prdoc for 4208 (#4239) 2024-04-22 12:06:16 +00:00
Branislav Kontur ff7e2c88a4 Sanitize UniversalLocation witth GlobalConsensus + XCM small nits and improvements (#4238)
This PR:
- sanitizes all `UniversalLocation`s with `GlobalConsensus` (when
possible) - addressing
[comment](https://github.com/paritytech/polkadot-sdk/pull/4025#discussion_r1557361473)
- adds `DefaultConfig` for `pallet-xcm-benchmarks` for `system`
2024-04-22 11:34:04 +00:00
Branislav Kontur e0202ece63 [xcm] Assets: sort after prepend_with (#4235)
Adds sorting to the XCM Assets' `prepend_with`, which could modify the
order of `AssetId` locations.

Relates to: https://github.com/paritytech/polkadot-sdk/pull/4186 (the
same fix for `reanchored`)
Part of: https://github.com/paritytech/polkadot-sdk/pull/2129
2024-04-22 11:26:32 +00:00
Liam Aharon 253778c94d ci: disallow westend migration failure (#4205)
Co-authored-by: Bastian Köcher <git@kchr.de>
2024-04-22 05:08:38 +00:00
gui f3c3ebb6a9 Fix case in type in macro generation (#4223)
Generated type is not camel case this generate some warnings from IDE

label should be R0
2024-04-20 08:20:35 +00:00
Ankan e504c41a5a Allow privileged virtual bond in Staking pallet (#3889)
This is the first PR in preparation for
https://github.com/paritytech/polkadot-sdk/issues/454.

## Follow ups:
- https://github.com/paritytech/polkadot-sdk/pull/3904.
- https://github.com/paritytech/polkadot-sdk/pull/3905.

Overall changes are documented here (lot more visual 😍):
https://hackmd.io/@ak0n/454-np-governance

[Maybe followup](https://github.com/paritytech/polkadot-sdk/issues/4217)
with migration of storage item `VirtualStakers` as a bool or enum in
`Ledger`.

## Context
We want to achieve a way for a user (`Delegator`) to delegate their
funds to another account (`Agent`). Delegate implies the funds are
locked in delegator account itself. Agent can act on behalf of delegator
to stake directly on Staking pallet.

The delegation feature is added to Staking via another pallet
`delegated-staking` worked on
[here](https://github.com/paritytech/polkadot-sdk/pull/3904).

## Introduces:
### StakingUnchecked Trait
As the name implies, this trait allows unchecked (non-locked) mutation
of staking ledger. These apis are only meant to be used by other pallets
in the runtime and should not be exposed directly to user code path.
Also related: https://github.com/paritytech/polkadot-sdk/issues/3888.

### Virtual Bond
Allows other pallets to stake via staking pallet while managing the
locks on these accounts themselves. Introduces another storage
`VirtualStakers` that whitelist these accounts.

We also restrict virtual stakers to set reward account as themselves.
Since the account has no locks, we cannot support compounding of
rewards. Conservatively, we require them to set a separate account
different from the staker. Since these are code managed, it should be
easy for another pallet to redistribute reward and rebond them.

### Slashes
Since there is no actual lock maintained by staking-pallet for virtual
stakers, this pallet does not apply any slashes. It is then important
for pallets managing virtual stakers to listen to slashing events and
apply necessary slashes.
2024-04-20 00:05:34 +00:00
maksimryndin 4eabe5e0dd Pvf refactor execute worker errors follow up (#4071)
follow up of https://github.com/paritytech/polkadot-sdk/pull/2604
closes https://github.com/paritytech/polkadot-sdk/pull/2604

- [x] take relevant changes from Marcin's PR 
- [x] extract common duplicate code for workers (low-hanging fruits)

~Some unpassed ci problems are more general and should be fixed in
master (see https://github.com/paritytech/polkadot-sdk/pull/4074)~

Proposed labels: **T0-node**, **R0-silent**, **I4-refactor**

-----

kusama address: FZXVQLqLbFV2otNXs6BMnNch54CFJ1idpWwjMb3Z8fTLQC6

---------

Co-authored-by: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
2024-04-19 13:36:36 +00:00
Alexandru Vasile eba3deca3e txWatch: Stabilize txWatch to version 1 (#4171)
This PR stabilizes the txBroadcast API to version 1.

Needs from spec:
- https://github.com/paritytech/json-rpc-interface-spec/pull/153 
- https://github.com/paritytech/json-rpc-interface-spec/pull/154


cc @paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-19 09:48:44 +00:00
Alexandru Vasile 148d942ec0 txBroadcast: Stabilize to version 1 (#4169)
This PR stabilizes the txBroadcast API to version 1.

Ideally needs:
- https://github.com/paritytech/polkadot-sdk/pull/4050
- https://github.com/paritytech/polkadot-sdk/pull/3772

cc @paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-19 09:28:48 +00:00
Bulat Saifullin 69f4373178 Provide WSS bootnodes for Rococo and Westend parachains (#4161)
Some Rococo parachains lacked WS nodes. `ws/wss` endpoints are necessary
for using light clients on the testnet.

Changes:
1. Add `ws/wss` endpoints to all testnet parachains.
2. Remove decommissioned nodes (`people-collator-node-2`
`people-collator-node-3` ).
2024-04-19 09:04:03 +00:00
Svyatoslav Nikolsky 21308d893e Fixed GrandpaConsensusLogReader::find_scheduled_change (#4208) 2024-04-19 08:34:46 +00:00
Andrei Sandu 04a9071e2a Use higher priority for PVF preparation in dispute/approval context (#4172)
Related to https://github.com/paritytech/polkadot-sdk/issues/4126
discussion

Currently all preparations have same priority and this is not ideal in
all cases. This change should improve the finality time in the context
of on-demand parachains and when `ExecutorParams` are updated on-chain
and a rebuild of all artifacts is required. The desired effect is to
speed up approval and dispute PVF executions which require preparation
and delay backing executions which require preparation.

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
2024-04-19 08:15:59 +00:00
Andrei Eres 4f125d1928 Update subsystem-benchmark params (#4201)
- Returned latency (with it, results are more stable)
- The threshold is weakened
- Increased number of runs
2024-04-19 07:35:56 +00:00
Alexandru Vasile 98a364fe6e rpc-v2: Limit transactionBroadcast calls to 16 (#3772)
This PR limits the number of active calls to the transactionBroadcast
APIs to 16.

cc @paritytech/subxt-team 

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: James Wilson <james@jsdw.me>
2024-04-19 04:34:26 +00:00
Alexandru Vasile 88a2f36023 chainHead: Stabilize chainHead to version 1 (#4168)
This PR stabilizes the chainHead API to version 1.

Needs:
- https://github.com/paritytech/polkadot-sdk/pull/3667

cc @paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-18 17:19:04 +00:00
Alexandru Vasile c891fdabf4 tx: Remove tx_broadcast transaction from the pool (#4050)
This PR ensures that broadcast future cleans-up the submitted extrinsic
from the pool, iff the `broadcast_stop` operation has been called.

This effectively cleans-up transactions from the pool when the
`broadcast_stop` is called.

cc @paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2024-04-18 15:57:44 +00:00
Alexandru Gheorghe 37e338f046 approval-voting: Make sure we always mark approved candidates approved in a different relay chain context (#4153)
... see for more detail why this is needed

https://github.com/paritytech/polkadot-sdk/issues/4149#issuecomment-2058472444

## TODO:
- [x] Unittests
- [x] Replicate scenario from
https://github.com/paritytech/polkadot-sdk/issues/4149 and confirm this
fixes it: https://github.com/paritytech/polkadot-sdk/issues/4149 [
Replicated on a zombienet with some hacked nodes, that we can end up in
this state where no-wake is schedule and the nodes are pending new
assignments]

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>
2024-04-18 15:57:34 +00:00
Alexandru Gheorghe 0e552893d0 Fix next_retry busy waiting on first retry (#4192)
The `next_retry_time` gets populated when a request receives an error
timeout or any other error, after thatn next_retry would check all
requests in the queue returns the smallest one, which then gets used to
move the main loop by creating a Delay
```
futures_timer::Delay::new(instant.saturating_duration_since(Instant::now())).await,
```

However when we retry a task for the first time we still keep it in the
queue an mark it as in flight so its next_retry_time would be the oldest
and it would be small than `now`, so the Delay will always triggers, so
that would make the main loop essentially busy wait untill we received a
response for the retry request.

Fix this by excluding the tasks that are already in-flight.

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>
2024-04-18 15:57:23 +00:00
Alexander Samusev 9f12d2196e [ci] Use native git cli in cargo (#4200)
More details can be found
[here](https://github.com/paritytech/ci_cd/issues/939#issuecomment-2064061845)
2024-04-18 15:57:22 +00:00
ordian 91d4a207af chain-selection: allow reverting current block (#4103)
Block reversion of the current block is technically possible as can be
seen from

https://github.com/paritytech/polkadot-sdk/blob/39b1f50f1c251def87c1625d68567ed252dc6272/polkadot/runtime/parachains/src/disputes.rs#L1215-L1223

- [x] Fix the test
2024-04-18 14:32:14 +00:00
Alexander Samusev 4ddeda1e41 [ci] Use ci-unified reference (#4196)
close https://github.com/paritytech/ci_cd/issues/974
2024-04-18 14:22:00 +00:00
Egor_P ff906127ab Improve changelog in the release notes (#4179)
This PR adds description to each of the sections of the Changelog part.
Changes are based on feedback that it wasn't that clear what exactly
`Node Dev`, `Runtime Dev` etc. means. Now, the description for each of
those parts is taken directly from the `prdoc` schema.
Closes https://github.com/paritytech/release-engineering/issues/197
2024-04-18 10:30:31 +00:00
Alexander Samusev 76719da221 [ci] Update ci image with rust 1.77 and 2024-04-10 (#4077)
cc https://github.com/paritytech/ci_cd/issues/974

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <info@kchr.de>
2024-04-18 09:24:16 +00:00
Alexander Samusev b6fab8046e [ci] Run test-linux-stable-int on self-hosted GitHub Runners (#4178)
PR adds `test-linux-stable-int` and `quick-benchmarks` as github action
jobs. It's a copy of `test-linux-stable-int` and `quick-benchmarks` from
gitlab ci and now it's needed to make a stress test for self-hosted
github runners. `test-linux-stable-int` and `quick-benchmarks` in gitlab
are still `Required` whereas this workflow is allowed to fail.

cc https://github.com/paritytech/infrastructure/issues/46
2024-04-18 07:40:45 +00:00
Tin Chung d591b16f6b Remove NotConcrete error (#3867)
# Description
- Link to issue: https://github.com/paritytech/polkadot-sdk/issues/3651

polkadot address: 19nSqFQorfF2HxD3oBzWM3oCh4SaCRKWt1yvmgaPYGCo71J
2024-04-18 06:44:49 +00:00
Muharem 305d311d5c Asset Conversion: Pool Touch Call (#3251)
Introduce `touch` call designed to address operational prerequisites
before providing liquidity to a pool.

This function ensures that essential requirements, such as the presence
of the pool's accounts, are fulfilled. It is particularly beneficial in
scenarios where a pool creator removes the pool's accounts without
providing liquidity.

---------

Co-authored-by: command-bot <>
2024-04-17 16:45:01 +00:00
PG Herveou aa78fe2180 Contracts: Refactor test builder (#4158)
- Moved `substrate/frame/contracts/src/tests/builder.rs` into a pub
test_utils module, so we can use that in the
`pallet-contracts-mock-network` tests
- Refactor xcm tests to use XCM builders, and simplify the use case for
xcm-send
2024-04-17 16:43:56 +00:00
Oliver Tale-Yazdi 7a2c9d4a9a Fix nostd build of several crates (#4060)
Preparation for https://github.com/paritytech/polkadot-sdk/pull/3935

Changes:
- Add some `default-features = false` for the case that a crate and that
dependency both support nostd builds.
- Shuffle files around of some benchmarking-only crates. These
conditionally disabled the `cfg_attr` for nostd and pulled in libstd.
Example [here](https://github.com/ggwpez/zepter/pull/95). The actual
logic is moved into a `inner.rs` to preserve nostd capability of the
crate in case the benchmarking feature is disabled.
- Add some `use sp_std::vec` where needed.
- Remove some `optional = true` in cases where it was not optional.
- Removed one superfluous `cfg_attr(not(feature = "std"), no_std..`.

All in all this should be logical no-op.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2024-04-17 15:52:00 +00:00
Alexandru Vasile bfbf7f5d6f chainHead: Report unique hashes for pruned blocks (#3667)
This PR ensures that the reported pruned blocks are unique.

While at it, ensure that the best block event is properly generated when
the last best block is a fork that will be pruned in the future.

To achieve this, the chainHead keeps a LRU set of reported pruned blocks
to ensure the following are not reported twice:

```bash
	 finalized -> block 1 -> block 2 -> block 3
	
	                      -> block 2 -> block 4 -> block 5
	
	           -> block 1 -> block 2_f -> block 6 -> block 7 -> block 8
```

When block 7 is finalized the branch [block 2; block 3] is reported as
pruned.
When block 8 is finalized the branch [block 2; block 4; block 5] should
be reported as pruned, however block 2 was already reported as pruned at
the previous step.

This is a side-effect of the pruned blocks being reported at level N -
1. For example, if all pruned forks would be reported with the first
encounter (when block 6 is finalized we know that block 3 and block 5
are stale), we would not need the LRU cache.

cc @paritytech/subxt-team  

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

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
2024-04-17 15:29:29 +00:00
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