Commit Graph

5415 Commits

Author SHA1 Message Date
Kian Paimani b3fabde4e3 make remote ext use batch ws-client (#8916)
* make remote ext use batch ws-client

* Add debug log for key length

* better assertions

* new sanity_checl

* try and make it work with batch

* update test

* remove exctra uri

* add missing at

* remove unused rpc stuff

* improve

Co-authored-by: emostov <32168567+emostov@users.noreply.github.com>
2021-05-29 04:20:25 +00:00
Sebastian Müller 1888e56abc weather -> whether (#8938) 2021-05-28 23:32:00 +02:00
joe petrowski 32b793657a remove duplicate Issued/Burned events (#8935) 2021-05-28 19:22:49 +00:00
Shawn Tabrizi 444d4e204c Simple MaxBoundedLen Implementations (#8793)
* implement max_values + storages info

* some formatting + doc

* sudo sanity check

* timestamp

* assets (not working)

* fix assets

* impl for proxy

* update balances

* rename StoragesInfo -> PalletStorageInfo

* merge both StorageInfoTrait and PalletStorageInfo

I think it is more future proof. In the future some storage could make
use of multiple prefix. Like one to store how much value has been
inserted, etc...

* Update frame/support/procedural/src/storage/parse.rs

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

* Update frame/support/procedural/src/storage/storage_struct.rs

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

* Fix max_size using hasher information

hasher now expose `max_len` which allows to computes their maximum len.
For hasher without concatenation, it is the size of the hash part,
for hasher with concatenation, it is the size of the hash part + max
encoded len of the key.

* fix tests

* fix ui tests

* Move `MaxBoundedLen` into its own crate (#8814)

* move MaxEncodedLen into its own crate

* remove MaxEncodedLen impl from frame-support

* add to assets and balances

* try more fixes

* fix compile

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

* nits

* fix compile

* line width

* fix max-values-macro merge

* Add some derive, needed for test and other purpose

* use weak bounded vec in some cases

* Update lib.rs

* move max-encoded-len crate

* fix

* remove app crypto for now

* width

* Revert "remove app crypto for now"

This reverts commit 73623e9933d50648e0e7fe90b6171a8e45d7f5a2.

* unused variable

* more unused variables

* more fixes

* Add #[max_encoded_len_crate(...)] helper attribute

The purpose of this attribute is to reduce the surface area of
max_encoded_len changes. Crates deriving `MaxEncodedLen` do not
need to add it to `Cargo.toml`; they can instead just do

```rust
\#[derive(Encode, MaxEncodedLen)]
\#[max_encoded_len_crate(frame_support::max_encoded_len)]
struct Example;
```

* fix a ui test

* use #[max_encoded_len_crate(...)] helper in app_crypto

* remove max_encoded_len import where not necessary

* update lockfile

* fix ui test

* ui

* newline

* fix merge

* try fix ui again

* Update max-encoded-len/derive/src/lib.rs

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

* extract generate_crate_access_2018

* Update lib.rs

* compiler isnt smart enough

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Co-authored-by: Peter Goodspeed-Niklaus <peter.r.goodspeedniklaus@gmail.com>
2021-05-28 18:35:15 +00:00
Alexander Theißen 61859bbdb1 Bump parity-wasm and pwasm-utils to the newest versions everywhere (#8928) 2021-05-28 11:06:16 +00:00
Alexander Theißen bf9837499a Fix check runtime CI (#8930)
* Fix check_runtime.sh script

* contracts: Remove confusing "Related Modules" doc
2021-05-28 09:33:22 +00:00
MOZGIII c8ea0c7abb More sc-service config reexports (#8887)
* Reexport ExecutionStrategies and ExecutionStrategy

* Reexport more of the network

* Reexport the ExecutionStrategy as it's used within ExecutionStrategies
2021-05-27 20:32:22 +00:00
Denis Pisarev 95e296dea3 CI: fix simnet trigger (#8927)
* CI: chore

* CI: pin simnet version
2021-05-27 20:31:29 +02:00
Roman Proskuryakov 8dfb8cd978 Remove: (#8748)
* `NetworkStatusSinks`
* `sc_service::SpawnTasksParams::network_status_sinks`

Also:
* `sc_service::build_network()` does not return `network_status_sinks`
2021-05-27 12:54:37 +00:00
Shawn Tabrizi fa89414bba Fix Compiler Warnings (new rustc) (#8907)
* unused mmr

* more unused

* dyn in executor

* remove `doc(inline)`

* fix dyn for sp-api-test

* update benchmarks

* Update primitives/core/benches/bench.rs

* Update primitives/core/benches/bench.rs

* update another bench

* fix benchmark?

Co-authored-by: adoerr <0xad@gmx.net>
2021-05-27 07:52:05 +02:00
Keith Yeung 053be60b82 Convert impl_key_prefix_for to proc macro (#8844)
* Convert impl_key_prefix_for to proc macro

* Reduce the number of let bindings

* Remove parsing of inputs for impl_key_prefix_for_tuples

* Replace unwrap with expect

* Remove unnecessary array of idents

* Use numeric identifiers

* Simplify ident generation

* Fix whitespacing

* Add documentation for impl_key_prefix_for_tuple proc macro

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

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-05-26 23:22:35 +00:00
Shumo Chu c110425251 Manta Network ss58 address registration (#8706)
* manta network ss58 address registration

* minor
2021-05-26 22:58:41 +02:00
Jakub Pánik 60345c9ffc Add Basilisk ss58 (#8882) 2021-05-26 20:47:56 +02:00
Jon Häggblad acef22bbd2 Migrate pallet-grandpa to attribute macros (#8724)
* frame/grandpa: migrate Config

* frame/grandpa: migrate decl_module

* frame/grandpa: migrate decl_event

* frame/grandpa: migrate decl_error

* frame/grandpa: migrate decl_storage

* frame/grandpa: make report_equivocation_unsigned pub(super)

* frame/grandpa: remove unused imports

* frame/grandpa: replace deprecated Module with Pallet

* frame/grandpa: add RawEvent for compatibility

* frame/grandpa: create migration to new storage prefix

* frame/grandpa: bump version to 4.0.0

* frame/grandpa: address review comments

* Try using version 3.1 instead

* frame/grandpa: tweak log text to say cancelled
2021-05-26 16:26:15 +00:00
Denis Pisarev 4ee5da2403 Revert "Fix stderr in new Rust nightly (#8904)" (#8910)
This reverts commit 2928e42800.
2021-05-26 13:51:28 +02:00
André Silva 61507e1ba3 grandpa: enable light clients to participate in gossip (#8796)
* network: allow gossiping to light clients

* grandpa: gossip global messages to light clients

* grandpa: don't send neighbor packets to light clients

* grandpa: fix tests

* grandpa: export run_grandpa_observer

* node: run grandpa observer on light client

* node: start network at end

* Use wasm_timer in finality-grandpa

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2021-05-26 11:33:11 +00:00
Kian Paimani 0d13e20b35 add an absolute measure of election score on-chain as a parameter (#8903)
* add an absolute measure of election score on-chain as a parameter

* make it storage item

* line width

* some nits

* Apply suggestions from code review

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

* make a few more things pub

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-05-26 08:49:45 +00:00
MOZGIII ee13ff2947 Convert Into to From to make clippy happy (#8900) 2021-05-26 09:16:53 +02:00
Alexander Theißen c92d4a2638 contracts: Fix some minor bugs around instantiation (#8879)
* Fix output of wrongly outputted error

The "Tombstoned a contract that is below the subsistence threshold: {:?}" was
triggered when too few balance was provided. It was a false alarm.

* Fix return of wrong code_len

* Split up `NotCallable` into more fine grained errors

* Fix typos in docs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* RentNotPayed -> RentNotPaid

* Fix typo: payed -> paid

It is OK to change the in-storage field name because:

1. The SCALE encoding is not based on names only on position.
2. The struct is not public (only to the crate).

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-05-25 22:29:55 +00:00
Denis Pisarev a28a517c53 Fix build job (#8905)
* CI: fix node-template packaging

* add explicit deps versions
2021-05-25 23:01:00 +02:00
Denis Pisarev 2928e42800 Fix stderr in new Rust nightly (#8904)
* CI: revert me

* fix stderr

* CI: revert me

* typo

* more stderr fixes

* Revert "CI: revert me"

This reverts commit 5f47effc4965fa5c0c2a6ed92e434a6adb6b1dce.

* Revert "CI: revert me"

This reverts commit 7f785660c797b703dd36272cbe313056dd7a1858.
2021-05-25 22:58:42 +02:00
Frederik Schulz ad76ac798e Removes unnecessary blank impl for Backend (#8897)
* Removes unnecessary blank impl for Backend

This commit removes a from my perspective unneccessary implementation
for &T which implement Backend.

The current implementation exists (again from my perspective) solely
to satisfy a methods &mut self parameters (i.e. allows to satisfy
this for an & reference via using &mut &Backend).

As all implementors use a RefCell with borrow_mut() where actually
calling the mentioned &mut self method and then forwad to the
{} implementation of either TrieBackend or ProvingBackend, the
current &mut self seems to be not needed.

* Fixed tests client
2021-05-25 19:50:12 +00:00
Kian Paimani ec409615a3 make remote-ext work with ws and safe RPCs (#8889)
* make remote-ext work with ws and safe RPCs

* Update docs.

* Update utils/frame/remote-externalities/Cargo.toml

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* Fix test

* Update lock file

* Update utils/frame/remote-externalities/src/lib.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Fix build again.

* revert lifetime stuff

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-05-25 18:00:50 +00:00
Bastian Köcher 53e28b98e9 Introduce code_substitute (#8898)
This introduces a new field `code_substitute` into the chain spec. This
can be used to substitute the on-chain wasm starting from a given block
until there is another wasm on chain (determined through the
`spec_version`). This can be used to fix broken on chain wasm runtimes.
2021-05-25 14:07:36 +00:00
Pierre Krieger a7a326ee07 Make sure nodes don't hammer each other even when reserved (#8901)
* Make sure nodes don't hammer each other even when reserved

* Make the ban random
2021-05-25 11:03:35 +00:00
Gavin Wood 45478043cf Default 2048 heap pages (#8892) 2021-05-24 14:32:39 +02:00
Tim Gestson 14befab52e Remove now unneeded empty hooks and calls #8873 (#8874)
* Remove now unneeded empty hooks and calls

* fix pallet_ui tests
2021-05-23 16:30:46 +00:00
Bastian Köcher 4dc8f3a7e5 Aura improvements (#8881)
* Aura: Expose function to build the verifier

* Use best block to initialize the authorities cache

* Use best block when determining the slot duration

* Remove `AuraBlockImport`

* Some cleanups

* Fix build error
2021-05-22 21:01:11 +00:00
André Silva 00328dca24 grandpa: fix warp sync proof on missing data (#8795)
* grandpa: check for missing data when iterating through authority set changes

* grandpa-warp-sync: handle missing data
2021-05-22 17:12:42 +00:00
Parth 77eba1351a add ExternalitiesExt for TestExternalities (#8877) 2021-05-21 10:21:12 +00:00
Alexander Theißen 637281556c Update README.md (#8871) 2021-05-21 10:00:25 +00:00
Guillaume Thiolliere 25625a0f0c Introduce WeakBoundedVec, StorageTryAppend, and improve BoundedVec API (#8842)
* fix bounded vec doc and unsafe

* fix btree map and set and tests

* introduce weak_bounded_vec and StorageTryAppend

* fix tests and reorganize tests

* improve doc

* add doc

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

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

* fix inner doc

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
2021-05-21 09:07:00 +00:00
Andreas Doerr a183031eef Fix doc for CryptoStore::ecdsa_sign_prehashed() (#8876)
* fix ecdsa_sign_prehashed() doc

* document both instances
2021-05-21 09:52:20 +02:00
ferrell-code 39a7decd1c Pallet-Multisig to framev2 (#8741)
* the great migration

* benchmarks to work

* unnecessary T: Config

* Update frame/multisig/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update frame/multisig/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update frame/multisig/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update frame/multisig/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update frame/multisig/src/lib.rs

* line width

* get to compile

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
2021-05-21 06:40:19 +00:00
Alexander Theißen 06d87ba464 The code generated by the interface macro did compare to the wrong module (#8872) 2021-05-20 20:42:44 +00:00
Keith Yeung e5954cf863 Make hooks and call attributes optional in pallet macro (#8853)
* Make #[pallet::hooks] optional

* Make #[pallet::call] optional

* Remove unused imports

* Update UI test expectations

* Update UI test expectations

* Remove unnecessary HooksDef::empty method

* Remove unnecessary CallDef::empty method

* Clarify what would happen when no call or hooks are specified in a pallet
2021-05-20 19:31:56 +00:00
arshamparity 029b8a1d07 add trigger for monitoring job in cloud-infra repository (#8831)
* add trigger for monitoring job in cloud-infra repository

* remove substrate-alerting-rules.env file for artifact:reports:dotenv

* add allow failure to trigger-cloud-infra-monitoring job

* remove strategy=depend from the trigger pipeline

Co-authored-by: Arsham <arsham@parity.io>
2021-05-20 16:27:16 +03:00
Alexander Theißen 0057c0b53f contracts: Add seal_rent_status (#8780)
* Move public functions up in rent.rs

* Added RentStatus

* Fix test name for consistency

Co-authored-by: Michael Müller <michi@parity.io>

* Mark rent functions as unstable

* Add unstable interfaces to README

* Fix doc typos

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

* Use DefaultNoBound

* Simplify calc_share(1)

* Don't output empty debug messages

* Make `seal_debug_message` unstable

Co-authored-by: Michael Müller <michi@parity.io>
Co-authored-by: Andrew Jones <ascjones@gmail.com>
2021-05-20 12:01:43 +00:00
Xiliang Chen f29a6fdad3 Update decimals & website for Karura (#8863) 2021-05-20 10:11:07 +00:00
Pierre Krieger ff60db4c41 Update the Grafana dashboards (#8832)
* Update the Grafana dashboards

* Remove the panels on top
2021-05-20 08:34:52 +00:00
Guillaume Thiolliere 693529df63 Fix transaction payment fee/tip unbalanceds (#8860)
* fix and test

* fmt
2021-05-19 18:44:50 +02:00
Guillaume Thiolliere c48b460b2e Improve pallet macro error message by deriving codec with no bound for Call enum (#8851)
* improve span for call

* fix stderr file paths
2021-05-19 09:23:06 +00:00
Bastian Köcher ee726ed55d Improve impl_opaque_keys! (#8856)
The macro should assume less about the scope where it is being used in.
In this case it is about not assuming that the crate where the macro is
called in provides a `std` feature.
2021-05-19 08:37:42 +00:00
Bastian Köcher 6a6f330412 Make wasmtime the default when the feature is enabled (#8855)
* Make wasmtime the default when the feature is enabled

* Update client/cli/src/arg_enums.rs

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

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2021-05-19 08:29:32 +00:00
Guillaume Thiolliere 0b30049417 Allow to name the generic for storages in #[pallet::storage] (#8751)
* implement named generic for storages

* fix error message on unexpected name for generic
2021-05-19 07:11:11 +00:00
Andreas Doerr ed39290f91 Add CryptoStore::ecdsa_sign_prehashed() (#8838)
* Pair::sign_prehashed()

* add CryptoStore::ecdsa_sign_prehashed()

* add test for testing keystore

* address review comments
2021-05-18 16:07:45 +02:00
Kian Paimani b5f23bfd1c Ensure election offchain workers don't overlap (#8828)
* Initial version, well tested, should work fine.

* Add one last log line

* Update frame/election-provider-multi-phase/src/unsigned.rs

Co-authored-by: Gavin Wood <gavin@parity.io>

* Update frame/election-provider-multi-phase/src/unsigned.rs

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

* Update frame/election-provider-multi-phase/src/unsigned.rs

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

* Fix a few more things

* fix build

* rewrite the whole thing with a proper lock

* clean

* clean some nits

* Add unit tests.

* Update primitives/runtime/src/offchain/storage_lock.rs

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

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Fix test

* Fix tests

Co-authored-by: Gavin Wood <gavin@parity.io>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-05-18 12:22:06 +00:00
Sergei Shulepov bee5c2dd71 Emit wasm sections only when compiling to wasm (#8845) 2021-05-18 12:06:35 +00:00
stanly-johnson 2b8be8cf1e Migrate pallet-scheduler to pallet attribute macro (#8769)
* migrate to pallet!

* fixes

* fix genesis

* code review fixes

* Update frame/scheduler/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update frame/scheduler/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update frame/scheduler/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update frame/scheduler/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Update frame/scheduler/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* fix metadata

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-05-18 08:52:17 +00:00
Andreas Doerr a68ed7c3d8 [clippy] Fix clippy issues for crate sp-core (#8809)
* Fix clippy issues for crate sp-core

* Update primitives/core/benches/bench.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Update primitives/core/src/ed25519.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Remove clippy attributes

* Missed a clippy attribute

* remove clippy attributes for bechmarks as well

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2021-05-18 09:38:56 +02:00