Commit Graph

7382 Commits

Author SHA1 Message Date
Squirrel deeaa1c8fd Use the balance trait as we have one (#13136) 2023-01-13 14:47:18 +01:00
Adrian Catangiu 8ac1de8f04 sp-beefy: align authority id key type with its signature type (#13131)
Still allows custom message hasher, but ties together the crypto
types used for private+public keys and the signature.

Signed-off-by: acatangiu <adrian@parity.io>
2023-01-13 14:52:18 +02:00
Vladimir Istyufeev b8ebe3dc52 CI: Unpin ci-linux and use Rust 1.66.1 (#13134) 2023-01-13 14:32:29 +04:00
Davide Galassi 7aa88e6a59 Stop keeping track of epoch changes for the sync gap (#13127)
* Stop keeping track of epoch changes data within the sync gap

* Fix docs

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <git@kchr.de>

* Fix typo

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-01-12 20:36:31 +01:00
Adrian Catangiu cf7bf3d142 client/beefy: fix logs (#13130)
Minor change to logs but required to minimize spamming during initial BEEFY deployment.
2023-01-12 15:49:01 +02:00
David Dunn c077597afb Optimize merkle proofs for efficient verification in Solidity (#12857)
* Sort hashes when generating & verifying MMR proofs

* Remove unused variables

* Double-hash leaves in beefy-merkle-tree

* Revert "Double-hash leaves in beefy-merkle-tree"

This reverts commit f788f5ed85e575a866639316aaef29dffbcd1c8c.

* Retry Polkadot companion CI jobs
2023-01-12 05:23:57 +00:00
Oliver Tale-Yazdi ff5c46c510 Scheduler is already at V4 (#13105)
* Scheduler is already at V4

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix Referenda log target

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-01-11 16:16:56 +00:00
dependabot[bot] ced0281e56 Bump git2 from 0.14.4 to 0.16.0 (#13123)
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.14.4 to 0.16.0.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/0.14.4...git2-curl-0.16.0)

---
updated-dependencies:
- dependency-name: git2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-11 15:59:13 +00:00
Bastian Köcher 1b01bf8da2 IntegrityTest implementation should be feature gated (#13094)
* `IntegrityTest` implementation should be feature gated

The initial implementation for the old declarative macros is still feature gating the
implementation. As we only call this in a test, there is no need to have this compiled for wasm.

* Don't assume that all "consumers" have a `std` feature
2023-01-11 15:40:52 +00:00
Jegor Sidorenko 836acb1bd3 [NFTs] Track item's metadata depositor (#13124)
* Refactor do_mint()

* Track the depositor of item's metadata

* Revert back the access control

* On collection destroy return the metadata deposit

* Clear the metadata on item burn returning the deposit

* Address comments

* Fix clippy

* Don't return Ok on non-existing attribute removal
2023-01-11 13:27:59 +00:00
Green Baneling 643b69c64d Allow duplicate topics in smart contract events (#13065)
* Removed `has_duplicates` check form the `deposit_event`.
Removed the usage of `Error::DuplicateTopics`.

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts

Co-authored-by: command-bot <>
2023-01-11 13:22:22 +00:00
JP 406e8ca417 remove update-node-template (#13100)
will be moved to polkadot's pipeline

ref https://github.com/paritytech/release-engineering/issues/142
2023-01-11 09:03:24 +00:00
Vladimir Istyufeev 280fce7172 Update tests for 1.66 and switch CI to stable Rust 1.66 (#13118)
* Update UI tests for 1.66

* Fix `test_enum` assertion for Rust 1.66

* Fix another `test_enum` assertion for Rust 1.66

* Fix another `test_enum` assertion for Rust 1.66

* Fix another `test_enum` assertion for Rust 1.66
2023-01-10 21:08:28 +00:00
Anthony Alaribe c04e68fd01 introduce log-target constant to more frame pallets (#13116)
* introduce log-target constant to more frame pallets

* cargo fmt

* make LOG_TARGET in session public

* Update frame/elections-phragmen/src/lib.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/elections-phragmen/src/migrations/v3.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/elections-phragmen/src/migrations/v3.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/elections-phragmen/src/migrations/v3.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* move LOG_TARGET=runtime::session_historical to migrations module, where it's actually used

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-01-10 19:18:12 +00:00
JP 72f086b795 Avoid unintentionally canceling the scheduled crate publishing job (#13088)
* avoid unintentionally canceling the scheduled crate publishing job

because publish-crates and publish-crates-manual share the resource group
"crates-publishing", any instance of publish-crates-manual cancels a running
instance of publish-crates, as demonstrated by
https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2212179

a workaround for that unintended interaction is to avoid creating instances of
publish-crates-manual and instead require pipelines to be triggered manually by
checking $CI_JOB_MANUAL == "true"

* check manual pipelines by $CI_PIPELINE_SOURCE instead of $CI_JOB_MANUAL

* make crate-publishing pipelines uninterruptible

* use conditional includes to work around interruptible limitations

* organize comments

* remove interruptible from common pipeline

* wip: check include

* wip: check include

* fix include

* fix include

* fix include

* fix yaml

* fix yaml

* remove shared common-pipeline

* wip: retry common-pipeline

* move .default-template to .gitlab-ci.yml

* fix the pipeline

add comments

* fix default-pipeline.yml

* revert publish-crates-manual to when: manual

* move "needs:" back to publish-crates

* avoid manual repetition

* improve previous commit

* try to avoid manual repetition

* fix indentation

* minor adjustments

* move defaults to top of .gitlab-ci.yml

* fix positioning on default in the diff

* comments

* indentation

* Apply suggestions from code review

Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com>

Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com>
2023-01-10 12:01:44 +00:00
alexgparity dcbccbd641 Add solution hint to error message (#13111)
* Add solution hint to error message

* make it compile

* Update frame/support/procedural/src/pallet/expand/hooks.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/support/procedural/src/pallet/expand/storage.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/support/procedural/src/pallet/expand/storage.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/support/procedural/src/pallet/expand/storage.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-01-10 11:32:19 +00:00
Luis Enrique Muñoz Martín a83f73ff7c Add ensure_pow method (#13042)
* add ensure_pow method

* reexport checked_pow and ensure_pow
2023-01-09 19:04:24 +00:00
Vlad f67f9f0405 CI: configure cargo-nextest's reporter options explicitly (#13104) 2023-01-09 21:36:27 +04:00
Gonçalo Pestana fcdd8a88ad EPM and staking events improvement (#13035)
* EPM and staking events improvement

* Uses RawOrigin in ElectionCompute event

* Refactors new phase events to PhaseTransition event

* PhaseTransitioned and remove RawOrigin from event

* Adds helpers for epm phase transition and staking force new

* addresses review comments

* nit: removes unecessary clone

* fixes benchmarks

Co-authored-by: parity-processbot <>
2023-01-09 16:06:47 +00:00
Sebastian Kunert b929e0282d Remove unused code in state-db (#13103) 2023-01-09 14:46:09 +01:00
Ankan 8f7971dca7 add note on usage of twox hash (#13089) 2023-01-09 08:33:29 +01:00
Oliver Tale-Yazdi d72f6176bc Run frame_system integrity tests in Externalities (#13092)
* Run frame_system integrity tests in Externalities

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use feature = 'std'

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-01-08 17:03:51 +00:00
Oliver Tale-Yazdi 2bc6078738 Remove unused types (#13091)
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-01-07 13:42:44 +00:00
Sebastian Kunert 123726f308 Remove unused finalization_displaced variable in db (#13090) 2023-01-06 21:09:57 +01:00
André Silva 56e8eedaa0 grandpa: bump version to v0.16.1 (#13080) 2023-01-06 11:52:38 +00:00
Nazar Mokrynskyi dccef86edb Only use substrate-wasm-builder when std feature is enabled. (#12790)
Co-authored-by: parity-processbot <>
2023-01-06 10:24:12 +00:00
Bastian Köcher 9fe5dd5f59 Do not leak records (#13086) 2023-01-06 10:41:17 +01:00
Falco Hirschenberger 79ca126419 Update trybuild to avoid random test failures. (#13073)
* Update trybuild to avoid random test failures.

A feature was added to trybuild >1.0.70 avoid failing on different variant
counts in the line `and 278 others`

fixes #12955

* Update all trybuild deps to latest version

* Update Cargo.lock
2023-01-06 09:45:56 +01:00
Sasha Gryaznov 628efddce1 [contracts] Add docs generator for the contracts API to the #[define_env] macro (#13032)
* macro to expand traits for host functions documentation

* other way: same Doc trait in seal modules

* added docs for macro, and remove `doc` attribute

* fmt

* Apply suggestions from code review

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* make docs to be generated into re-exported `api_doc` module; fix
unrelated elder docs;

* make it compile without `doc` attr passed to macro

* make alias functions indicated explicitly in docs

* tidy up docs

* refactored a bit

* macro to auto-add doc warning for unstable functions

* invoke macro with no doc generation by default

* addressed review comments

* hide api_doc module behind cfg(doc)

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
2023-01-05 23:22:43 +00:00
Bastian Köcher 876fccc0e5 Kademlia: Speed-up the record fetching (#13081)
Before libp2p 0.50.0 we used a quorum of one to fetch records from the DHT. In the pr that upgraded
to libp2p 0.50.0 we accidentally changed this behavior. This pr brings back the old behavior of
using a qorum of one and thus, a faster discovery. After finding the first value, we directly finish
the query. There was also another behavior change in libp2p, they stopped automatic caching on
remote nodes. This pr also brings back the remote caching on nodes that are nearest to the key from
our point of view of the network.

The pr that changed the behavior in libp2p: https://github.com/libp2p/rust-libp2p/pull/2712
2023-01-05 22:11:27 +01:00
André Silva 37e137e57d aura: remove stale check to skip execution (#13074) 2023-01-05 15:19:24 +00:00
Bastian Köcher 3a68a7818b Return RuntimeVersion of overwritten/substituted wasm binary (#13066)
* Adds test

* Ensure we are using the runtime version of the override/substitute wasm

* Update client/service/src/client/call_executor.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

Co-authored-by: Anton <anton.kalyaev@gmail.com>
2023-01-05 13:45:40 +01:00
André Silva 44768ae56a grandpa: remove deprecated afg log target (#13064)
* grandpa: remove deprecated afg log target

* grandpa: define log targets in primitives
2023-01-05 12:33:08 +00:00
Anton f2dcd9520c upgrade libp2p to 0.50.0 (#12734)
* upgrade libp2p to 0.50.0

* on_swarm_event and on_connection_handler_event

* replace `Swarm::new` with `Swarm::with_threadpool_executor`

* on_swarm_event and on_connection_handler_event part 2

* on_swarm_event and on_connection_handler_event part 3

* on_swarm_event and on_connection_handler_event part 4

* update libp2p

* libp2p 0.50.0

* rename OutboundQueryCompleted to OutboundQueryProgressed

refs https://github.com/libp2p/rust-libp2p/pull/2712

* remove unused var

* accumulate outbound_query_records until query is finished

* format code

* use p_handler instead of new_handler

https://github.com/paritytech/substrate/pull/12734#discussion_r1027640610

* pass ListenFailure to kademlia

https://github.com/paritytech/substrate/pull/12734#discussion_r1034716664

* use tokio executor in tests

https://github.com/paritytech/substrate/pull/12734#discussion_r1039291776

* use chrono Local::now

instead of deprecated Local::today

* remove unused vars from request_responses tests

* attempt to fix pallet UI tests

* restart CI

* restart CI

* restart CI

* restart CI

* restart CI

* restart CI

* restart CI

* restart CI
2023-01-05 12:03:41 +00:00
Bastian Köcher 428a42752a Aura: Do not verify on state import (#13058)
* Aura: Do not verify on state import

When we import the state, we can not fetch authorities to verify the seal etc. So, we can directly
skip any verification.

* Skip checks as well for gap sync

* Update client/consensus/aura/src/import_queue.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Review comment

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2023-01-04 13:17:18 +00:00
Oliver Tale-Yazdi 78621b8dac Remove Copy from Ensure* traits (#13043)
* Remove Copy from EnsureOp and EnsureOpAssign

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove Copy from EnsureFrom and EnsureInto

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix default impl

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Reuse assignment code in Ensure trait

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Require Ensure for all BaseArithmetic types

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix assign impls

Co-authored-by: Luis Enrique Muñoz Martín <lemunozm@gmail.com>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add success doc tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-01-04 13:00:30 +00:00
André Silva 841fcaba2c grandpa: pass the actual best block to voting rules (#12477)
* grandpa: pass the actual best block to voting rules

* grandpa: add test for checking best header is passed to voting rule
2023-01-04 12:49:02 +00:00
Oliver Tale-Yazdi d0bbec32ad Selectable on-runtime-upgrade checks (#13045)
* Make try-runtime checks selectable

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/support/src/traits/try_runtime.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Add Clap wrapper for enum UpgradeCheckSelect

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert "Add Clap wrapper for enum UpgradeCheckSelect"

This reverts commit e29538c1a79d1711b43addc9400d871f6aa32844.

* fix pools sanity check

* Set default for --checks to None

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make --checks backwards comp

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add clap attr comment

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: kianenigma <kian@parity.io>
2023-01-04 12:44:41 +00:00
Jegor Sidorenko 7ead16802e Allow to clear attributes via traits (#13055) 2023-01-04 08:31:24 +00:00
Jegor Sidorenko 25b4f8c688 Disallow burning externally locked nfts (#13054)
* Disallow burning externally locked nfts

* Update docs
2023-01-04 08:30:43 +00:00
Jegor Sidorenko ae72d1cdf9 Fix pallet's integration (#13056) 2023-01-04 08:30:12 +00:00
cuteolaf 83c1ffd7a5 remove unused constant: MaxValueSize (#12839) 2023-01-03 22:41:31 +00:00
Bastian Köcher 8508c0ed1f Do not run forced_canonicalization for archive nodes (#13051)
We don't canonicalize on archive nodes and thus `best_canonical` always returned `None`. So, the
moment such a node tried to force canonicalize, it was trapped in some endless loop.

This pr solves this by renaming `best_canonical` to `last_canonicalized` and also making the return
value more clear by introducing a custom enum `LastCanonicalized`.
2023-01-03 23:00:34 +01:00
Liu-Cheng Xu 1db2dc5b36 Enrich TooManySiblingBlocks error info (#13052) 2023-01-03 23:00:10 +01:00
Ankan 169cbc69c5 Use #[pallet::storage_version] for pallet staking (#12728)
* delete releases

* use standard pallet storage version

* migrate to standard storage version for staking

* not compiling

* keep old releases enum around for decoding

* fix releases

* rename old releases

* retriggering ci

* fix migration comments

* doc update

Co-authored-by: parity-processbot <>
2023-01-03 20:45:58 +01:00
Sergej Sakac 5af801ce60 Forbid stray tokens in call index (#13036)
* Check for call_index

* fixes

* pallet ui test for weight attribute

* Update frame/support/procedural/src/pallet/parse/call.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* fix

* small fix

* wrong return type

* ...

* .

* final fix

* update .stderr

* commit

* udpate

* Update frame/support/procedural/src/pallet/parse/call.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* update .stderr

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-01-02 10:23:33 +00:00
Michal Kucharczyk 9c69fc1b32 BlockId removal: refactor: BlockBackend::block|block_status (#13014)
* BlockId removal: refactor: BlockBackend::block|block_status

It changes the arguments of:
-  `BlockBackend::block`
-  `BlockBackend::block_status`

method from: `BlockId<Block>` to: `Block::Hash`

This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)

* non-obvious reworks

* doc fix

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <git@kchr.de>

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: parity-processbot <>
2023-01-02 09:42:05 +00:00
Éloïs 66cfd01f17 try-runtime: add cli option --export-proof (#12539)
* try-runtime: add cli option --export-proof

* extract proof in raw json format

* fix build

* fix(try-runtime execute-block): wrong block parsing

* fmt

* apply suggestions

* Update utils/frame/try-runtime/cli/src/lib.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

* Update utils/frame/try-runtime/cli/src/lib.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

* Update utils/frame/try-runtime/cli/src/lib.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

* Update utils/frame/try-runtime/cli/src/lib.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

* split off external dependencies

* fmt

* fix try-runtime compilation

Co-authored-by: Anton <anton.kalyaev@gmail.com>
2022-12-30 17:54:04 +00:00
Vlad 46d4eb2a05 Unpin ci-linux and use the latest production tag as before (#13030) 2022-12-29 19:46:56 +04:00
Vlad 0d35943574 Enable zstd for rusty-cachier (#13029) 2022-12-29 19:20:41 +04:00