Commit Graph

3142 Commits

Author SHA1 Message Date
Bastian Köcher 43e34bb909 Make wasm-builder remove invalid members (#4510)
* Make wasm-builder remove invalid members

Wasm-builder now removes members that point to packages that do not
exist anymore or that were renamed. Up to now, the build would fail and
required manual fixing.

* Fixes build
2019-12-29 21:54:10 +01:00
Bastian Köcher 56355879be Fix cli for structopt 0.3.7 and pin to that version (#4509)
* Fix cli for structopt 0.3.7 and pin to that version

This is just some hotfix to make everything compile. In the future it
will require another pr to not depend on internals of StructOpt, but
that will probably also require some additions to StructOpt itself. To
not break the code again with another StructOpt, this also pins the
StructOpt version.

* Fix benches

* Fix for fix
2019-12-28 22:52:18 +01:00
Denis Pisarev 9876d3dd09 less dupes, cleanup (#4491)
* build node job is separated from build substrate; less dupes, cleanup

* it's not effective yet to split these jobs
2019-12-28 17:00:39 +01:00
Nikolay Volf 885f94dfad Improve subkey error reporting. (#4504) 2019-12-27 21:07:04 +01:00
Bastian Köcher 47639339f6 Support loading the URI from a file in subkey (#4503)
* Support loading the URI from a file in subkey

* Fix tests
2019-12-27 09:12:25 +01:00
Nikolay Volf 96744926b2 Check aura slot numbers are strictly increasing (#4020)
* initial block import handler

* fix node template

* fix error message

* fix error message again

* final fixes

* fix node template again
2019-12-26 14:04:07 +01:00
Weiliang Li 5431f09a4e fix ligature (#4497) 2019-12-25 09:01:17 +01:00
Weiliang Li fe587c72ec Use sc_network::NetworkStateInfo instead of implementing redundant traits (#4436)
* Implement local_peer_id for gossip

* refactor local_peer_id

* fix

* reset gossip

* Update tests.rs

* fix ci

* fix review

* fix Cargo.lock

* fix Cargo.lock
2019-12-24 16:17:19 +01:00
Xiliang Chen 901dff5d14 use generated ModuleToIndex type (#4495) 2019-12-24 16:16:19 +01:00
Sergei Pepyakin 1f07123c6c Remove unnecessary unsafe. (#4494) 2019-12-24 14:16:14 +01:00
Sergei Pepyakin 1782fbbbba Extract execution engines definitions into their own crates (#4489)
* Clean imports in wasmi_execution

* Replace `interpret_runtime_api_result` with `pointer_and_len_from_u64`.

* Extract sc-executor-common crate

* Extract `sc-executor-wasmi` into its own crate

* Extract `sc-executor-wasmtime` into its own crate.

* Add missing headers.

* Clean and docs

* Docs for sc-executor-wasmi

* Expand a comment about sandboxing

* Fix assert_matches

* Rename (un)pack_ptr_and_len and move them into util module

* Remove wasmtime errors in sc-executor-common
2019-12-24 13:17:41 +01:00
Tomasz Drwięga b214b3f3e9 Fix replace_previous of Ready Transaction Queue. (#4488)
* Fix transaction replacements.

* Test.

* Fix typo.

* Update client/transaction-pool/graph/src/ready.rs

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2019-12-24 11:13:29 +01:00
Stanislav Tkach 2403cf320c Migrate election-phragmen, election contracts and authorship to decl_error (#4479)
* Migrate election-phragmen

* Migrate elections

* Migrate contracts module

* Update authorship module

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2019-12-24 11:11:57 +01:00
gabriel klawitter 9051945505 ci: increase git cloning depth to 100 (#4481)
* ci: increase git cloning depth to 100

* check_runtime: verify shallow git clones to contain origin/master

* check_runtime: fetch master branch
2019-12-23 19:43:05 +01:00
Stanislav Tkach f4a3056167 Change log level for DhtEvent::ValueNotFound from warn to debug (#4485) 2019-12-23 17:23:35 +01:00
Nikolay Volf 10cd358e40 fix warnings in grafana module (#4486) 2019-12-23 17:41:43 +03:00
Gavin Wood 205ddec344 Twitter field for IdentityInfo (in a back-compat way) (#4476) 2019-12-22 23:11:34 +01:00
Gavin Wood 3c70800eab Extend Utility pallet with multisig and pseudonyms (#4462)
* Add subaccounts functionality

* More work

* Multisig prototyped with tests

* Add timepoints to prevent replay

* Remove TODO

* Check for the right owner in cancel.

* Test the timepoint stuff

* Batch works with any origin

* Refactor tuples into structs.

* Finalise function docs/complexity and also add proper weights.

* Fix wasm

* Module-level docs

* Fix typo

* Runtime fix

* Better deposit system; more tests.

* Fix typo

* Switch +1 for -1

* Add Blake2_128Concat; fix insecurity; change return policy.

* Fix typo

* Update frame/utility/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/utility/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update bin/node/runtime/src/lib.rs

Co-Authored-By: Sergei Pepyakin <sergei@parity.io>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Sergei Pepyakin <s.pepyakin@gmail.com>
2019-12-22 20:41:55 +01:00
Wei Tang c3413fdea3 Clean up definition for custom ss58 address formats (#4470)
* Clearer definition for custom ss58 address formats

* Fix subkey compile
2019-12-21 15:34:36 +01:00
Stanislav Tkach 2c2e0d772d Migrate generic-asset, identity and im-online to decl_error (#4473)
* Migrate generic-asset, identity and im-online to decl_error

* Update democracy tests

* Update nicks test
2019-12-21 15:10:29 +01:00
Joshy Orndorff f6cbf4421f Rename ChainSpec field (#4471)
* initial rename

* nitpick: add space in "chain spec"

* Add comment to client spec.
2019-12-20 21:50:18 +01:00
Gavin Wood e6b8a69656 Add ProposalRejected event to Treasury (#4468)
Closes #4467

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2019-12-20 21:35:51 +01:00
Tomasz Drwięga 14a08d430c Add Clone bound to the Origin. (#4472) 2019-12-20 18:43:04 +01:00
Stanislav Tkach 328563f8d4 Migrate membership, nicks, scored-pool and session to decl_error (#4463)
* Migrate membership, nicks, scored-pool and session to decl_error

* Fix tests

* Update frame/scored-pool/src/tests.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Remove InsufficientBalance error from scored-pool

* Replace Error::<Test, DefaultInstance> with Error::<Test, _>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2019-12-20 17:12:21 +01:00
Arkadiy Paronyan 9950ea98fc Shared params in CLI API (#4466)
* Common shared parames getter

* Expose more types from `service-builder`

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2019-12-20 16:05:01 +01:00
Bastian Köcher bfad5f3ffc Fix warnings and make CI working again (#4469)
* Fix warnings and make CI working again

* Fix test
2019-12-20 14:47:19 +01:00
Svyatoslav Nikolsky 7d4c6354df use multiple threads in integration tests (#4379) 2019-12-20 12:37:21 +01:00
Bastian Köcher 054607f092 Subkey add support for interactive password (#4465)
* Subkey add support for interactive password

* Support inserting the URI from tty as well
2019-12-20 12:36:55 +01:00
Shawn Tabrizi 4fffe19c28 Update Balances Pallet for decl_error! (#4405)
* Update balances for `decl_error!`

* Update for new `decl_error`

* Fix staking tests

* Use `ok_or` over `match`
2019-12-20 00:23:20 +01:00
André Silva dfe87ec61e babe: remove unused slot_duration variable (#4461) 2019-12-19 17:38:01 +00:00
Stanislav Tkach d46eaf79aa Warn about using --rpc-external and --ws-external options (#4448)
* Warn about using --rpc-external and --ws-external options

* Apply review comments

* Remove links placeholders

* Add links to wiki
2019-12-19 17:57:42 +01:00
Gavin Wood bbda30c7dd Add new event for registering deposits. (#4459) 2019-12-19 17:57:20 +01:00
Shawn Tabrizi 1d04d5a05e Fix Fees in Substrate (#4421)
* Fix fees

* Add comment to explain saturated multiply accumulate

* Fix final fee calculation

* Fix doc

* improve doc

* grumble

* Update tests

* Fix executor tests
2019-12-19 14:03:00 +01:00
Ashley 9a1bb75809 Update grafana-data-source to tokio 0.2 (#4441) 2019-12-19 14:02:07 +01:00
Bastian Köcher 8e393aa5a8 Make decl_error! errors usable (#4449)
* Make `decl_error!` errors usable

This pr implements support for returning errors of different pallets in
a pallet. These errors need to be declared with `decl_error!`.

The pr changes the following:

- Each dispatchable function now returns a `DispatchResult` which is an
alias for `Result<(), DispatchError>`.
- `DispatchError` is an enum that has 4 variants:
  - `Other`: For storing string error messages
  - `CannotLookup`: Variant that is returned when something returns a
  `sp_runtime::LookupError`
  - `BadOrigin`: Variant that is returned for any kind of bad origin
  - `Module`: The error of a specific module. Contains the `index`,
  `error` and the `message`. The index is the index of the module in
  `construct_runtime!`. `error` is the index of the error in the error
  enum declared by `decl_error!`. `message` is the message to the error
  variant (this will not be encoded).
- `construct_runtime!` now creates a new struct `ModuleToIndex`. This
struct implements the trait `ModuleToIndex`.
- `frame_system::Trait` has a new associated type: `ModuleToIndex` that
expects the `ModuleToIndex` generated by `construct_runtime!`.
- All error strings returned in any module are being converted now to `DispatchError`.
- `BadOrigin` is the default error returned by any type that implements `EnsureOrigin`.

* Fix frame system benchmarks
2019-12-19 14:01:52 +01:00
Kian Paimani 0aab5c659e Few extra tests for phragmen (#4451) 2019-12-19 09:24:17 +01:00
Tomasz Drwięga 216f77d91f Document TransactionStatus and fix termination conditions. (#4446)
* Document TransactionStatus and fix termination conditions.

* Update client/rpc-api/src/author/mod.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-12-18 21:28:25 +01:00
Leo Arias 06e382b0d4 Fix typo in comment (#4433) 2019-12-18 21:17:22 +01:00
André Silva 1e550b3dac grandpa: fix slow gossip test (#4440) 2019-12-18 14:32:09 +01:00
André Silva 1fc3060feb grandpa: log everything under afg target (#4443) 2019-12-18 14:18:29 +01:00
Robert Habermeier 8f1b5b840d client: Do not set fork sync request via network-gossip (#4439)
The finality-grandpa module needs two sets of functionalities from the
network:

1. Everything gossip related, e.g. event_stream, write_notification, ...

2. The ability to set a fork sync request for a specific block hash.

Instead of embedding (2) inside of (1) this patch extracts (2) from (1)
having finality-grandpa depend on a `Network` that fulfills the
`network_gossip::Network` trait and that can set block sync requests.

On the one hand this improves the overall structure splitting things
that don't logically belong together. On the other hand it does
reintroduce a lot of trait bounds within finality-grandpa.
2019-12-18 14:17:13 +01:00
Robert Habermeier da87c3c1e3 RPCs for reserved peers (#4423)
* RPC forwarders for adding reserved peers

* implement service side of reserved-peer RPCs

* Clean up unnecessary format! invocation

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* add some tests for the new RPC methods

* remove redundant `data` field

Co-Authored-By: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
2019-12-18 14:12:15 +01:00
Weiliang Li 637d95e5ea Add dyn for slog::SerdeValue in telemetry (#4435) 2019-12-18 13:13:59 +01:00
Wei Tang 7af81c29c4 pallet-evm: default implementation for FeeCalculator and ConvertAccountId and separate gas price (#4424)
* Default implementation for FeeCalculator and ConvertAccountId and separate gas price

* Styling fixes and some docs addition

* TruncateConvertAccountId -> HashTruncateConvertAccountId

* Fix compile
2019-12-18 13:13:47 +01:00
Drew Stone d6ce5ae20e Add Edgeware network ID to core/crypto and subkey (#4426)
* Add linear back-off for aura slot workers

* logging

* Use slot from header

* Get network id for Edgeware and add to subkey
2019-12-18 12:51:24 +03:00
Shawn Tabrizi 57c19bcf4e More decl_error! migrations (#4427)
* Update assets to `decl_error`

* Update aura to `decl_error`

* Update authority discovery to `decl_error`

* Update collective to `decl_error`

* Update evm to `decl_error!`

* Fix error with replace

* Revert "Update authority discovery to `decl_error`"

This reverts commit 26e8f3c56656963d847e984c6f2c8e1f88014899.

* Revert "Update aura to `decl_error`"

This reverts commit 8f17c44ca8375a4a755710aaab7ad4d9522c4376.

* Update democracy to `decl_error`

* Update finality-tracker to `decl_error`

* Update grandpa to `decl_error`

* `assert` to `ensure` in dispatchable function
2019-12-18 12:50:21 +03:00
Gavin Wood 9550c845f3 Fix the subkey error message (#4428)
* Fix the subkey error message

* Fix check_benchmarks
2019-12-18 12:48:34 +03:00
Gavin Wood 608d633455 Remove incorrect assumption that runners-up were sorted by account (#4429)
* Remove incorrect assumption that runners-up were sorted by account

* Fix

* Update lib.rs
2019-12-18 12:48:15 +03:00
joe petrowski e6e9faaed6 minor typos in traits docs (#4425) 2019-12-17 21:33:11 +01:00
Shawn Tabrizi 337cae1dde Update Balances Pallet events to help block explorers (#4389)
* Dust moves from reserved <-> free if below ED

* Add dust information to `ReapedAccount` event

* Introduce `BalanceSet` event

* More cleanly written `set_balance` logic
2019-12-17 23:49:00 +08:00