Commit Graph

2504 Commits

Author SHA1 Message Date
Shawn Tabrizi c1a24fb537 Switch node template to use AuRa (#3790)
* Stuck on service

* Make service compile

* Remove Grandpa dependency

* Update node-template/runtime/Cargo.toml

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

* Fix build

* Update crypto import

* Update node-template/src/service.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Update node-template/src/service.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Update node-template/src/service.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Update node-template/src/service.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Update node-template/runtime/src/lib.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Fix macro dependency

* Trying to add grandpa back

* Update node-template/src/chain_spec.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Update node-template/src/chain_spec.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Update node-template/src/chain_spec.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Update node-template/src/service.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Update node-template/src/service.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Unused import

* Use grandpa block import
2019-10-18 11:58:31 +01:00
Xiliang Chen bf1786b628 remove unused file (#3851) 2019-10-18 12:58:04 +02:00
Kian Paimani 53e8200fb5 Update CONTRIBUTING.adoc (#3842)
* Update CONTRIBUTING.adoc

* fix typos

* Update CONTRIBUTING.adoc

Co-Authored-By: André Silva <andre.beat@gmail.com>
2019-10-18 12:41:57 +02:00
cheme d9cffa0bb5 Code redundancy between ext implementation and testing. (#3830)
* fix child_storage_hash

* extract common implementation for ext and testing

* cleaning impl.

* replace ExtBasisMut by actual Ext

* remove extbasis.

* Update tests to use Ext from test externalities.

* use Ext constructor for getting ext from TestExternalities.

* Add missing extensions from ext.

* fix wasmi test

* Fix merge error.
2019-10-18 09:52:25 +02:00
kwingram25 fddfcbacea Use Bytes for contract rpc input_data (#3841)
* Use Bytes for contract input_data

* Update srml/contracts/rpc/src/lib.rs
2019-10-18 09:28:48 +02:00
André Silva 5b9952ef1c grandpa: don't expire next round messages (#3845)
* grandpa: don't expire next round messages

* grandpa: fix test

* grandpa: first round in set is 1

* grandpa: fix test

* grandpa: update doc
2019-10-17 19:25:18 -04:00
Bastian Köcher 8051fd5445 Don't panic when we try to register 2 global loggers (#3840) 2019-10-17 17:35:41 -04:00
Kian Paimani 183c188111 refactor: Transaction-Payment module (#3816)
* Initial draft that compiles

* Extract payment stuff from balances

* Extract multiplier update stuff from system

* Some fixes.

* Update len-fee as well

* some review comments.

* Remove todo

* bump
2019-10-17 14:21:32 +02:00
Bastian Köcher 1711483fb6 Make VersionInfo derive Clone (#3839) 2019-10-17 12:54:28 +02:00
Ashley 411b8f96d4 Add error types to BABE and PoW (#3827)
* Add an error type to Babe

* Add an error type to PoW

* Simplify error enum variant names

* Update core/consensus/babe/src/lib.rs

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

* Add missing newline

* Split up DataProvider into CreateInherents and CheckInherents
2019-10-17 12:34:03 +02:00
Bastian Köcher 81c400e958 Make wasmi_execution public to use it from tests (#3829)
* Make `wasmi_execution` public to use it from tests

* Make `WasmRuntime` accessible as well

* Add `call_in_wasm` instead of making stuff public

* Use `WasmRuntime`

* Move test

* More feedback
2019-10-16 21:00:31 +02:00
thiolliere f4e36f0d74 Refactor decl storage (#3765)
* split implementation in multiple files:
  * transformation -> genesis_config/  getters.rs  instance_trait.rs  metadata.rs  mod.rs  store_trait.rs
  * mod.rs -> parser.rs
  * impl.rs -> storage_struct.rs
* parser is isolated into parse module, it could be improved as well but this can be done in another PR
* modules contains a defintion of decl_storage input which must be ok to work with.
* implementation change:
  * T: Trait might be more often bound to 'static (anyway we only use static one and it is needed for metadata current implementation).
  * GenesisConfig no longer requires its fields to be Clone (possible since to EncodeLike feature)
  * builder for map storages must return precise type Vec<(key, value)>
2019-10-16 15:47:46 +02:00
Tomasz Drwięga dc92631180 Move srml RPC extensions to separate crates (#3791)
* Move srml-system RPC out.

* Fix tests for system-rpc module.

* Contracts RPC moved.

* Fix rpc test.

* Clean up.

* Update lockfile.

* Bump runtime version.

* Update srml/contracts/rpc/runtime-api/src/lib.rs

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

* Bump impl version.
2019-10-16 12:40:35 +02:00
Ashley 642c8504c4 WIP: Node role RPC call (#3719)
* Add a Node Role RPC call

* Formatting

* Fix tests

* Change tests to use NodeRole::Authority so I don't forget to update the test

* Improve role checking

* return a vec instead

* fix tests
2019-10-16 11:59:25 +02:00
Fabio Tudone 8ef20a5534 Fix #1536: do not require to construct a block for encoding it (#3813)
* Fix #1536: do not require to construct a block for encoding it

* Bump `impl_version`

* Improve `Block::encode_from` signature and rustdoc (from review by @bkchr)
2019-10-16 10:02:12 +02:00
Demi Obenour 6a2afdb204 Bump dependencies, respecting semver (#3812) 2019-10-15 18:33:33 +02:00
André Silva 6c0e9fb107 chain spec builder: add generate mode for authority keys (#3811)
* core: use trait object for genesis constructor

* chain-spec-builder: use structopt

* chain-spec-builder: add new command to generate authority keys

* chain-spec-builder: use ? in main

* chain-spec-builder: fix stored and printed suri from seed

* chain-spec-builder: add comment about created keystore folders

* chain-spec-builder: simplify file write
2019-10-15 15:07:56 +01:00
Tomasz Drwięga 9fe8ee4197 Fix asynchronous transaction rejections. (#3817)
* Fix handling transaction pool errors.

* Add test.

* Review suggestions.
2019-10-15 11:16:10 +02:00
André Silva ed449bf415 grandpa: fix until imported logging arg order (#3818) 2019-10-14 20:19:01 -04:00
Bastian Köcher e3ae647c42 Provide macro for exporting functions from wasm (#3801)
The macro generates the functions with the signature we expect for wasm
functions. This macro is useful for tests where we need to call into
wasm. Parameter passing is done by SCALE encoding the input and output
parameters.
2019-10-14 20:20:07 +02:00
Kian Paimani b989c6f9ba Update tests.rs (#3814) 2019-10-13 17:22:53 +02:00
André Silva 6e5fe1a557 deps: update clap and structopt (#3809) 2019-10-12 18:31:49 +01:00
André Silva ea3b9bf393 node: re-use testnet genesis spec for staging testnet (#3802) 2019-10-12 17:12:03 +02:00
yjh 625d697e26 fix comments (#3808)
Signed-off-by: yjhmelody <465402634@qq.com>
2019-10-12 11:32:29 +02:00
Caio f60bc521c3 Fix Typo (#3805)
The `chain::error::FutureResult` doc is currently referring to the wrong
structure
2019-10-12 00:16:51 +01:00
Gavin Wood eba7df9a7b Fix semantics of ExistenceRequirement::KeepAlive. (#3796)
* Fix semantics of ExistenceRequirement::KeepAlive.

* Bump runtime version
2019-10-11 13:59:26 +02:00
Bastian Köcher 4dbc9265ee Add execute_with to TestExternalities (#3793)
This function executes the given closure in a context where the test
externalities are set. This makes the srml tests easier to write, as the
test externalities need to be created anyway.
2019-10-10 15:01:30 +02:00
Xiliang Chen 34c7338211 Decouple randomness-collective-flip (#3792)
* Abstract Randomness trait

* bump version

* fix doc test

* simpify code a bit

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* fix tests
2019-10-10 12:41:42 +02:00
Kian Paimani 21fae718c4 Multi-limb arithmetic for runtime (#3743)
* First working version of all operations.

* New and improved version of everything.

* Minor cleanup.

* Fix build

* Finalize nignum

* Some final works on refactors and tests.

* fix build

* Some review comments

* Bench, better try into and nits

* mutify the API

* rename to big_uint

* unmutify.

* Remove resize

* Apply suggestions from code review

* Update core/sr-primitives/src/sr_arithmetic.rs

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>

* BEtter proof

* Fix panic doc.

* Bump.
2019-10-10 09:52:08 +02:00
Demi Obenour 4da48dd9f5 Bump dependencies (#3787)
* Update dependencies, respecting semver

* Bump dependencies

* Don’t patch tiny-bip39 dependency
2019-10-09 12:29:28 -04:00
Bastian Köcher 8a39be474e Move Externalities into its own crate (#3775)
* Move `Externalities` into `substrate-externalities`

- `Externalities` now support generic extensions
- Split of `primtives-storage` for storage primitive types

* Move the externalities scoping into `substrate-externalities`

* Fix compilation

* Review feedback

* Adds macro for declaring extensions

* Fix benchmarks

* Introduce `ExtensionStore` trait

* Last review comments

* Implement it for `ExtensionStore`
2019-10-09 15:50:30 +02:00
André Silva 984c6ac839 babe: verify slots are strictly increasing (#3785)
* babe: re-use code to propose and import test block

* babe: add failing test for slot validation

* babe: verify slot numbers are strictly increasing
2019-10-08 21:56:22 +02:00
Demi Obenour 8108f1decd Update dependencies, respecting semver (#3784) 2019-10-08 21:09:05 +02:00
Ashley 968a30685f Split off System random functions into a new Randomness module (#3699)
* split off system randomness functions into a new module

* bump spec and impl version

* Move randomness to bottom of construct_runtime calls, move initialization into on_initialize

* Update srml/randomness/Cargo.toml

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

* Update srml/randomness/src/lib.rs

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

* Update srml/randomness/src/lib.rs

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

* Update srml/randomness/Cargo.toml

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

* Improve system example

* Update Cargo.lock

* Fix randomness example

* Get rid of the stored index

* Add tests

* Add a random test

* Improve docs

* Fix executive test :^)

* Add a utility function to tests

* Update srml/randomness/Cargo.toml

Co-Authored-By: Gavin Wood <github@gavwood.com>

* Update srml/randomness/src/lib.rs

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

* Update srml/randomness/src/lib.rs

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

* Change interpretation of block numbers

* rename crate

* refactor randomess module usage

* change random material len to a const

* Update srml/randomness-collective-flip/src/lib.rs

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

* Update srml/randomness-collective-flip/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-10-08 17:31:39 +02:00
Weiliang Li 520009973f gossip: save sender for kept messages (#3738) 2019-10-08 16:16:24 +01:00
Jim Posen 6cebbbf8b2 Refactor NativeExecutor to support multiple Wasm execution methods (#3677)
* executor: Move definitions of externals out of wasm_executor module.

* executor: Create WasmRuntime trait.

This will be used to decouple the runtime cache from wasmi execution.

* executor: Remove WasmExecutor and move methods to wasmi_execution.

These will now be crate-internal functions and there is no need
for the struct.

* executor: Set default default_heap_pages in NativeExecutor.

* cli: CLI configuration for Wasm execution method.

* executor: Remove wasmi-specific code from wasm_runtime.

* Respond to review comments.
2019-10-08 12:57:12 +02:00
Xiliang Chen 2c77262c8f expose module errors into metadata (#3752)
* expose module errors into metadata

* it checks

* Tests for error metadata

* Apply suggestions from code review

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

* remove inherent errors from metadata

* bump version

* Apply suggestions from code review

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

* Update srml/support/src/error.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
2019-10-08 11:30:16 +02:00
Kian Paimani 38a61861b1 Example of how to inspect arguments in weight calculation (#3753)
* document how to make a custom weight calculator

* Simpler explanation and implementation.

* remove unneeded where
2019-10-08 09:23:27 +02:00
André Silva 7ecd8496a7 client: fix comparison of CachedHeaderMetadata in tree_route (#3776)
* client: fix comparison of CachedHeaderMetadata in tree_route

* client: add regression test for tree_route
2019-10-07 15:28:28 +02:00
Bruno Škvorc 7cb0d73944 Alternative sysvar setup for Windows (#3761)
* Alternative sysvar setup for Windows

The command line setup did not work for me. This adds instructions and images on how to do it through the UI.

* Modified instructions to use Powershell, removed images from PR.
2019-10-07 09:34:10 +02:00
Svyatoslav Nikolsky 32e687abe4 Fix state RPC subscriptions on light node (#3626)
* fetch all keys at once in light RPC subscriptions

* restore lost fil
2019-10-07 08:00:15 +02:00
Hernando Castano 168051c060 Make the purge-chain prompt a little nicer (#3772) 2019-10-06 15:44:32 +02:00
Bastian Köcher 1a327cd894 srml-utility: Store errors as DispatchError to make the decodable (#3766) 2019-10-05 13:06:38 +02:00
Micheal Waltz 954e980ae3 Fix docker builds #3731 (#3767) 2019-10-05 13:04:22 +02:00
André Silva b181951bcc babe: prune the epoch tree on startup (#3768) 2019-10-05 10:44:07 +02:00
Marcio Diaz 65ef193ec8 Use header metadata in babe verify. (#3756)
* Use header_metadata in verify.

* Log hash in header_metadata error.

* Fix naming, error.
2019-10-05 10:43:19 +02:00
kaichao 789ead9beb Fix RustDoc generation. (#3763)
* Attemp to fix it.

* Move env to the begining.
2019-10-04 21:30:50 +02:00
André Silva f1cdaae6de babe: small compilation fix (#3764)
* babe: fix type on find_pre_digest call

* fork-tree: optimize prune

* babe: fix test compilation
2019-10-04 19:55:03 +01:00
André Silva 49fb11a1ea babe: ancient epoch tree pruning (#3746)
* babe: prune epoch tree when importing a new epoch change

* fork-tree: fix tree pruning

* babe: actually prune epoch change fork tree

* Fix typos

* babe: add test for epoch tree pruning

* fork-tree: fix pruning of stale forks
2019-10-04 19:51:08 +02:00
Gavin Wood ac0270518c Utility module for doing stuff like batch calls (#3759)
* Implement and test batch

* Add files.

* Remove comments.

* Update srml/utility/src/lib.rs

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

* Fixes
2019-10-04 19:13:54 +02:00