Commit Graph

5297 Commits

Author SHA1 Message Date
tgmichel db4acd4866 Add future transactions pool accessor to ValidatedPool (#8673) 2021-05-01 06:02:47 +00:00
Tomasz Drwięga 46095af452 subkey: display SS58 encoding of public key (#8674)
* Add SS58 public key encoding.

* [Companion] Update Cargo.toml subkey version, readme to reflect new output (#8694)

* Update Cargo.toml

* update cargo, readme for subkey

Co-authored-by: Dan Shields <danwshields@gmail.com>

Co-authored-by: Dan Shields <35669742+NukeManDan@users.noreply.github.com>
Co-authored-by: Dan Shields <danwshields@gmail.com>
2021-04-29 15:23:03 +00:00
Roman Proskuryakov be1dce5618 Fix reliance on non-empty NodeInfo::endpoints (#8684)
* Use as_deref instead of .map in Node::client_version

* Fix reliance on non-empty NodeInfo::endpoints
2021-04-29 13:37:05 +00:00
Hernando Castano 06670046bc Bump jsonrpsee to alpha.6 release (#8690) 2021-04-28 22:36:28 +02:00
Gavin Wood 0d65a936d2 Remove unneeded Ord bound from All, Contains supports tuples (#8691)
* Remove unneeded `Ord` bound from All

* Fixes

* Contains supports tuples
2021-04-28 18:25:00 +02:00
Jon Häggblad a7facf25e4 grandpa-rpc: allow proving finality of blocks from latest authority set (#8585)
* grandpa: use new latest stored justification in prove_finality

* grandpa: include end in range in FinalityProof::unknown_headers

* grandpa: typo in comment

* grandpa: remove ProvableJustification

* grandpa: revert unnecessary changes

* grandpa: extend AuthoritySetChangeId and cleanup get_set_id

* grandpa: move check_finality_proof to the test module

* grandpa: warn on missing authority set changes data

* grandpa: add missing use statement

* grandpa: simplify finality_proof tests

* grandpa: additional tests for finality_proof

Co-authored-by: André Silva <andrerfosilva@gmail.com>
2021-04-28 11:13:39 +00:00
Jon Häggblad d3d02d8851 Support sending and receiving multiple Justifications (#8266)
* client/network: support sending multiple justifications

* network: flag support for multiple justifications in protobuf request

* Update client/network/src/protocol.rs

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* network: update comment on protobuf field

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2021-04-28 10:59:50 +00:00
Erasmus Hagen 1f02ec8ce4 Update slashing.rs (#8676)
Link was a dead-end
2021-04-28 07:59:40 +00:00
Gavin Wood d02c0222bc Introduce macro for building Contains impl based on a match (#8675)
* Introduce macro for building Contains impl based on a match

* Fixes
2021-04-27 14:33:59 +02:00
Michael Müller 536cee37f1 Upgrade cargo_metadata to 0.13.1 (#8670)
* Upgrade `cargo_metadata` to 0.13.1

* Update utils/wasm-builder/src/wasm_project.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-04-27 07:17:38 +00:00
Shawn Tabrizi 4225d50881 Add BoundedVec to Treasury Pallet (#8665)
* bounded treasury approvals

* update benchmarks

* update configs

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_treasury --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/treasury/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* fix weight param

Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
2021-04-26 14:42:09 +00:00
François Garillot 052be8bbef Simplify some Option / Result / ? operator patterns (#8653)
* Simplify some Option / Result / ? operator patterns

When those match a combinator exactly.

Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust).

* adjust after review

* adjust post-review
2021-04-23 13:36:10 +00:00
Bastian Köcher 541692c4a8 Use host max log level when initializing the RuntimeLogger (#8655)
* Use host max log level when initializing the `RuntimeLogger`

This should fix performance problems introduced by logging under certain
circumstances. Before we always called into the host and the host was
doing the log filtering, now as the correct max log level is set, we
don't call into the host for every log line to check if it should be
logged. However, we would still call into the host to determine if
something should be logged when `something=trace` is given as we don't
forward the log targets that are enabled.

* Finish the pr
2021-04-23 13:22:39 +00:00
Kian Paimani 8cc1af31c4 migrate pallet-elections-phragmen to attribute macros (#8044)
* All done

* Fix benchmarks

* Apply suggestions from code review

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Fix metadata.

* Fix build

* Add migrations

* Fix

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

* Better migeation test

* More test

* Fix warn

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

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Fix test

* early exit

* Fix

* Fix build

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-04-23 07:12:34 +00:00
Xiliang Chen 327934c19e impl Zero and One for fixed point numbers (#8647)
* impl Zero and One for fixed point numbers

* update librocksdb-sys to support M1

* fix build

* trigger CI
2021-04-22 22:02:54 +00:00
Tomasz Drwięga f7ed5a2481 Off-chain indexing is independent from workers (#8659)
* Pff-chain indexing is independent from worker.

* Remove unauthorized changes.

* 🤦
2021-04-22 21:37:03 +00:00
Alexander Theißen 166568b029 contracts: Allow () -> (i32) for backwards compatibility (#8656) 2021-04-22 10:44:35 +00:00
Niklas Adolfsson 70f008b9f1 update jsonrpsee to 0.2.0-alpha.5 (#8644) 2021-04-21 10:59:15 +00:00
Pierre Krieger 54ae55f439 Revert "Properly close notification substreams (#8534)" (#8646)
This reverts commit 6c9c687a31.

Co-authored-by: André Silva <andrerfosilva@gmail.com>
2021-04-20 18:39:07 +00:00
Pierre Krieger 86c5dc848f Authority-discovery no longer publishes non-global IP addresses (#8643)
* Authority-discovery no longer publishes non-global IP addresses

* Cargo.lock

* Update client/authority-discovery/src/lib.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

Co-authored-by: Andronik Ordian <write@reusable.software>
2021-04-20 13:42:58 +00:00
Pierre Krieger 3a72631439 Enable --no-private-ipv4 by default for live chains (#8642)
* Enable --no-private-ipv4 by default for live chains

* Make the selection a bit easier to read

* Update client/cli/src/params/network_params.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

Co-authored-by: Andronik Ordian <write@reusable.software>
2021-04-20 13:42:11 +00:00
André Silva a52adf448b client: remove time unit from block time loaded message (#8639) 2021-04-19 20:29:43 +00:00
Alexander Theißen 18000a9ae8 Update dependencies of pallet_contracts (#8637)
* Update parity-wasm

* Cleanup Cargo.toml files

- Sort dependencies
- Remove minor and fix version where they are not necessary

* Update pretty_assertions

* Update rand
2021-04-19 10:47:46 +00:00
Guillaume Thiolliere ea10494ca9 Make pallet macro generate accessor to PalletInfo information on pallet placeholder (#8630)
* generate accessor to PalletInfo information on pallet placeholder

* remove unused

* use trait, and add tests

* less verbose doc

* add PalletInfoAccess to prelude for ease usage
2021-04-19 10:09:23 +00:00
Pierre Krieger d64f79924a Update to libp2p 0.37 (#8625)
* Update to libp2p 0.37

* Line widths

* Fix tests
2021-04-18 08:04:45 +00:00
Kian Paimani b6b107030d Add benchmarks for pallet-membership (#8596)
* Add benchmakrs for membership

* Update frame/membership/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Make it all work

* Add mock weights

* Update frame/membership/src/lib.rs

* Update frame/membership/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_membership --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/membership/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_membership --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/membership/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
2021-04-18 04:52:05 +00:00
ferrell-code 92630df143 Authority Discovery to FRAME v2 (#8620)
* migrate to new macro

* formatting

* Apply suggestions from code review

* Update frame/authority-discovery/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-04-18 02:23:27 +00:00
Guillaume Thiolliere bb343c7c26 fix doc and dyn (#8631) 2021-04-17 17:01:31 +02:00
Denis Pisarev 4dcbac4b58 CI updates (#8633)
* CI: opt bench jobs; add bench to triggered job

* CI: no need in manual builds; build=publish

* CI: more logs to the trigger job

* CI: DAGs and louts
2021-04-16 21:35:08 +02:00
Bastian Köcher c8136bd1df Remove serde requirement from FRAME macros (#8628)
* Remove `serde` requirement from FRAME macros

Currently there is some implicit requirement on `serde` being present in
the `Cargo.toml` of a pallet when `GenesisConfig` is used. This pr
removes this requirement by using the serde attribute `serde(crate = "..")`.

* build a unique reexport of serde in impl_opaque_keys, by abusing paste doc concatenation

* Optimize

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
2021-04-16 12:42:37 +02:00
Daniel Olano 7527bd758c Make pallet Assets instantiable (#8483)
* Make pallet Assets instantiable

* use instantiable benchmarks

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-04-16 08:51:26 +00:00
Kian Paimani 6bcf5f21c4 BoundedVec + Shims for Append/DecodeLength (#8556)
* prototype for shawn

* Clean and document it

* Add more docs

* Move imports

* Some changes for easier compat.

* revert exmaple pallet

* rename

* BoundedVec for AccountLocks (#8580)

* Example with balances

* Fix tests

* Make it indexable

* fix

* Fix tests

* fix test

* Fix collective as well

* Fix test

* Update frame/support/src/storage/mod.rs

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

* Repot and add for value

* Add for map and double map

* Final touches.

* Update frame/support/src/storage/bounded_vec.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Add a few more tests

* Add import

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-04-16 06:06:05 +00:00
Pierre Krieger 6c9c687a31 Properly close notification substreams (#8534)
* Properly close notification substreams

* Some debug asserts

* Fix state inconsistency

* Remove erroneous debug_assert!

* Some comments
2021-04-15 10:42:47 +00:00
Bastian Köcher 14b5acab86 Introduce a "dynamic" block size limit for proposing (#8588)
* Introduce a "dynamic" block size limit for proposing

This adds support for using a dynamic block size limit per call to
`propose`. This is required for Cumulus/Parachains to always use stay in
the limits of the maximum allowed PoV size.

As described in the docs, the block limit is only checked in the process
of pushing transactions. As we normally do some other operations in
`on_finalize`, it can happen that the block size still grows when there
is some proof being collected (as we do for parachains). This means,
that the given block limit needs to be rather conservative on the actual
value and should not be the upper limit.

* Update client/basic-authorship/src/basic_authorship.rs

Co-authored-by: Andronik Ordian <write@reusable.software>

* More future proof encoded size updating

* Use `ProofRecorderInner`

* Update client/basic-authorship/src/basic_authorship.rs

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

* Update client/basic-authorship/src/basic_authorship.rs

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

* Update client/basic-authorship/src/basic_authorship.rs

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

* Update client/consensus/slots/src/lib.rs

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

* Update client/consensus/slots/src/slots.rs

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

* Update client/basic-authorship/src/basic_authorship.rs

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

* Update client/basic-authorship/src/basic_authorship.rs

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

* Update client/basic-authorship/src/basic_authorship.rs

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

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
2021-04-14 17:56:22 +00:00
Pierre Krieger 2fa6f2fbd5 Fix debug_assertion failing in authority discovery (#8599)
* Fix debug_assertion failing in authority discovery

* Improve test

* Change the map_or for invalid addresses

* Remove debug_assertion
2021-04-14 13:19:33 +00:00
Pierre Krieger c227ff78d8 Increase metric only if actually publishing (#8618) 2021-04-14 12:40:18 +00:00
Pierre Krieger fa89371a17 Make non-validators listen on /ws by default (#8609)
* Make non-validators listen on /ws by default

* Fix WS path
2021-04-14 09:44:09 +00:00
Vladislav d0933c4634 Add Sora network SS58 Address (#8261)
* Add Sora network SS58 Address

Signed-off-by: Vladislav Markushin <negigic@gmail.com>

* Update Sora network SS58 Address to `69`

Signed-off-by: Vladislav Markushin <negigic@gmail.com>

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
2021-04-14 09:16:12 +00:00
André Silva fd0700abad build: update shell.nix (#8616) 2021-04-14 08:58:26 +00:00
Peter Goodspeed-Niklaus 33425ce21f Trim compact solution for length during preparation (#8317)
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2021-04-13 15:17:32 +02:00
Xiliang Chen 3351cb8869 expose set_timestamp for runtime benchmarks (#8601)
* expose set_timestamp for runtime benchmarks

* Update frame/timestamp/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-04-13 13:52:20 +02:00
Alexander Theißen f854194139 contracts: Add RPC that allows instantiating of a contract (#8451)
* contracts: Add RPC that allows instantiating of a contract

* Encode `debug_message` as bytes because usage of `String` is forbidden

* Remove erroneous derive attribute

* Fix rpc tests for new `debug_message` encoding

* Fix typo

Co-authored-by: Andrew Jones <ascjones@gmail.com>

Co-authored-by: Andrew Jones <ascjones@gmail.com>
2021-04-13 11:26:52 +00:00
Falco Hirschenberger 24311eee3e Change assert(is_err()) to assert_noop to check state consistency on errors (#8587)
* Change is_err() asserts in tests to assert_noop to check state consistency

fixes #8545

* Update frame/transaction-payment/src/lib.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/contracts/src/exec.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/democracy/src/benchmarking.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/transaction-payment/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Don't assert no-changing state.

see: https://github.com/paritytech/substrate/pull/8587#issuecomment-817137906

* fix expected error

* Fix non-extrinsic-call asserts

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-04-13 10:44:27 +00:00
Chris D'Costa b9ed6e01b3 Change i8 to u8 on WithdrawReasons #8586 (#8591) 2021-04-13 10:10:14 +00:00
Guillaume Thiolliere a4ed9bb9b2 Ensure inherent are first (#8173)
* impl

* fix tests

* impl in execute_block

* fix tests

* add a test in frame-executive

* fix some panic warning

* use trait to get call from extrinsic

* remove unused

* fix test

* fix testing

* fix tests

* return index of extrinsic on error

* fix test

* Update primitives/inherents/src/lib.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* address comments

rename trait, and refactor

* refactor + doc improvment

* fix tests

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2021-04-13 09:30:13 +00:00
Denis Pisarev 6679b88af8 WIP: fix Simnet trigger (#8493)
* CI: trigger guard [skip ci]

* CI: variables and dotenv [skip ci]

* CI: correct variable for simnet trigger

* CI: correct rules for simnet trigger

* fix linting issue :)

* CI: trigger simnet via API

Co-authored-by: radupopa2010 <radupopa2010@yahoo.com>
2021-04-13 01:29:21 +02:00
Bastian Köcher 6378a4ee78 Pallet macro support frame_system::Config with args (#8606) 2021-04-12 19:11:23 +00:00
Chris D'Costa 0cbd3b4f46 #8597 Update features resolver wasm build (#8598) 2021-04-12 18:43:22 +00:00
Keith Yeung 3b8a0ffa6a Fix buggy string comparison in OCW pallet example (#8602) 2021-04-12 20:40:20 +02:00
Bastian Köcher 59b900bae3 Fix parameter_types! macro (#8594)
Make it work with different kinds of parameter types when
`static` is one of them.
2021-04-12 19:37:35 +02:00