Commit Graph

8072 Commits

Author SHA1 Message Date
Robert Habermeier c61d03a86f fix overflow in slashing logic (#1263) 2018-12-13 12:33:03 +01:00
Benjamin Kampmann bd2a206e40 Add cli param to limit database cache size (#1261)
* Add cli param to limit datbase cache size

* fixing tests
2018-12-13 12:32:41 +01:00
Simon Warta 8606595a6d Add simple keygen command to subkey (#1250)
* Remove _ prefix from variable

* Handle empty pattern in vanity tool

* Deduplicate and fix account printing

* Add comment on restore subcommand

* Add simple keygen command
2018-12-12 15:32:00 +01:00
Bastian Köcher 3c7ee7d041 Use dev as id in development_config_genesis (#1259) 2018-12-12 15:29:12 +01:00
Sergei Pepyakin ce91da6b89 srml-contract: introduce ext_caller external function (#1255)
* Implement ext_caller.

* Rebuild wasm.

* Update COMPLEIXTY.md
2018-12-12 14:00:21 +01:00
Svyatoslav Nikolsky c1b0fba486 do not compute storage root (+ changes root) when proving execution (#1246) 2018-12-12 10:35:37 +01:00
Robert Habermeier 20782baeef add on_exit parameter to aura thread builder (#1249) 2018-12-11 13:43:53 +01:00
Tomasz Drwięga d28fda3d84 [RPC] Move runtime version from chain to state (#1243)
* Move runtimeVersion to state, add rudimentary test for subscription.

* Bump to latest jsonrpc.
2018-12-10 19:46:39 +01:00
Robert Habermeier 6299b42a4d Punish offline validators, aura-style (#1216)
* make offline-reporting infrastructure more generic

* add a listener-trait for watching when the timestamp has been set

* prevent inclusion of empty offline reports

* add test for exclusion

* generate aura-offline reports

* ability to slash many times for being offline "multiple" times

* Logic for punishing validators for missing aura steps

* stub tests

* pave way for verification of timestamp vs slot

* alter aura import queue to wait for timestamp

* check timestamp matches seal

* do inherent check properly

* service compiles

* all tests compile

* test srml-aura logic

* aura tests pass

* everything builds

* some more final tweaks to block authorship for aura

* switch to manual delays before step

* restore substrate-consensus-aura to always std and address grumbles

* update some state roots in executor tests

* node-executor tests pass

* get most tests passing

* address grumbles
2018-12-10 18:37:08 +01:00
Arkadiy Paronyan dcc38fe45a Fixed common block tracking when syncing (#1235)
* Fixed common block tracking when syncing

* Fixed fork resolution
2018-12-10 17:31:36 +01:00
Gav Wood 66cbe232f5 Governance: Voters put money where mouth is (#1183)
* Referendums only gett enacted after a delay; successful voters must
lock funds up until enactment.

* Build fixes.

* Configurable council enact delay, fix test builds.

* Fix spelling

* Remove TODO
2018-12-10 17:29:40 +01:00
gabriel klawitter 6c0cfd1781 Upload builds to releases.parity.io (#1233)
* gitlab-ci.yml: upload binaries to s3

* gitlab-ci.yml: typo tag names

* gitlab-ci.yml: avoid dots in tags

* gitlab-ci.yml: try before_script

* gitlab-ci.yml: indentation

* gitlab-ci.yml: unified before_script

* gitlab-ci.yml: don't forget script

* use VERSION file

* build.sh only before builds

* git_strategy: none

* use own docker awscli image

* typo

* use artifacts folder

* enable uploads to s3 as well

* add builds.sh to tests
2018-12-10 17:24:35 +01:00
cheme 5f48493b9a Allow spaces in types for decl_storage proc_macro (#1245)
* Do not try to fix type display for metadata in rust.

* Fix test (adding extra space (we can see it as a canary: if at some
point quote got a better output the test will fail and js space removal
could be remove)).
2018-12-10 16:24:31 +01:00
Tomasz Drwięga 507c13e31c Move pool maintainance to a background task. (#1236)
* Move pool maintainance to a background task.

* Remove commented code.

* Add issue number to TODOs

* Fix warnings and tests.
2018-12-10 14:13:48 +01:00
Svyatoslav Nikolsky 742cb33d90 Make CallApiAt::call_api_at work at light client (#1213)
* light client contextual method call

* fixed off-by-one in test

* newlines + commas
2018-12-10 16:02:00 +03:00
Bastian Köcher acf1b77bcd Make decl_module not require a return type for functions (#1230)
If no return type is specified, `Result` is added and
`Ok(())` is returned by default.

Closes: #1182
2018-12-10 13:36:37 +01:00
Wei Tang 52ba9a5605 Update fixed-hash pin version and fix cargo locks (#1241) 2018-12-10 11:58:06 +01:00
Bastian Köcher 1f6719346f Make runtime api generate version and identifier information (#1226)
* Make `decl_runtime_apis!` implement `RuntimeApiInfo` for all runtime
apis

* Make the runtime side generate the info constants as well

* Make `RuntimeApiInfo` implementation use the correct generics

* Adds a test for the runtime api info stuff

* Remove duplicated code by using block from `test-client`

* Adds `compile_fail` tests for `api_version`

* Adds documentation for `api_version`

* Make `impl_runtime_apis!` generate `RUNTIME_API_VERSIONS`

* Update documentation and tests for `RUNTIME_API_VERSIONS`

* Implement `has_api` by using the `RuntimeApiInfo`

* Make `impl_runtime_apis` check that trait identifiers are unique

* Prefix all runtime api function with the corresponding trait

So `execute_block` will be called `Core_execute_block`.
This makes it possible to have traits implement a function with the
same name.

* Rebase master

* Update after master rebase
2018-12-10 11:48:07 +01:00
Bastian Köcher a4a67ccbe7 Make cli subcommands accept --dev, --chain and --base_path (#1214)
This restores an old behavior with more checks to inform the user
about misuse.
Only the `build-spec` parameter is not accepting these flags and options.
This subcommand only works with the options specified on the main command,
this is a restriction of the current cli parse/execute design.
2018-12-10 08:45:22 +01:00
Wei Tang 00410e636f Remove BestAuthorities (#1238) 2018-12-10 10:05:28 +03:00
cheme ed5b78eaf0 decl_storage as a proc_macro (#1176)
* `decl_storage` parsing of the macro (TODO change tool crate structure)

* Start formatting, for now use inner macro.
Still missing optional formating last part (genesis ...).

* Calling extra genesis macro

* decl_storage lines parsing.

* genesis macro as quote (need some cleaning reorg)

* dirty $crate substitute

* proc crate reorg.

* PR impl : skip usage of phantom data, it only applies in test and
council (others required it).

* Remaining macro of decl_storage, warning stringify behave sometime
oddly.

* Formatting code and some cleaning.

* Include line parsing to main struct (cannot use existing macro anymore).

* Remove genesis phantom data when there is already a field with type
parameter.

* Revert wasm files

* Remove old version of `decl_storage`.

* Fix false positive for phantom trait (additional type check on config
build).

* slight changes:
- return token errors instead of panic
- do not use useless intermediate vec

* Update srml/support/procedural/tools/derive/src/lib.rs

remove indent

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>

* Switch iterations to fold, remove unused import.
2018-12-09 21:09:39 +01:00
Wei Tang 3ffb45e3c8 Fix master test build (#1239) 2018-12-09 21:02:59 +01:00
André Silva e203c285e2 core: fix max depth handling of best_containing (#1234) 2018-12-08 22:29:51 +01:00
Tomasz Drwięga 90f6a56b15 Configure max payload for HTTP & WS (#1231) 2018-12-08 13:37:50 +08:00
André Silva e779eeb2ec Grandpa validator set handoff justification (#1190)
* core: make block justification optional

* runtime: update wasm binaries

* core: optionally pass justification on finalize_block

* finality-grandpa: add channel to trigger authority set changes

this will allow the `BlockImport` to trigger an authority set change when
importing a change block that provides a justification (when syncing)

* finality-grandpa: move finalize_block to free function

* finality-grandpa: add GrandpaOracle for auth set liveness checking

this will be used by `BlockImport` to check whether the authority set for a
given block is still live, if the authority set isn't live then importing a
change block requires a justification.

* finality-grandpa: store justification on finalized transition blocks

* finality-grandpa: check justification on authority set change blocks

* finality-grandpa: poll grandpa liveness oracle every 10 seconds

* finality-grandpa: spawn grandpa oracle in service setup

* core: support multiple subscriptions per consensus gossip topic

* finality-grandpa: create and verify justifications

* finality-grandpa: update to local branch of grandpa

* finality-grandpa: update to finality-grandpa v0.5.0

* finality-grandpa: move grandpa oracle code

* finality-grandpa: fix canonality check

* finality-grandpa: clean up error handling

* finality-grandpa: fix canonical_at_height

* finality-grandpa: fix tests

* runtime: update wasm binaries

* core: add tests for finalizing block with justification

* finality-grandpa: improve validation of justifications

* core: remove unused IncompleteJustification block import error

* core: test multiple subscribers for same consensus gossip topic

* Revert "finality-grandpa: improve validation of justifications"

This reverts commit 51eb2c58c2219801e876af6d6c9371bdd9ff2477.

* finality-grandpa: fix commit validation

* finality-grandpa: fix commit ancestry validation

* finality-grandpa: use grandpa v0.5.1

* finality-grandpa: add docs

* finality-grandpa: fix failing test

* finality-grandpa: only allow a pending authority set change per fork

* finality-grandpa: fix validator set transition test
2018-12-08 13:34:59 +08:00
Jordan Beauchamp da822276dd Move create network folder structure to top level of start_service (#1224)
Fixes issue where the network folder is not created when run
with '--node-key' arg
2018-12-07 10:08:20 +01:00
gabriel klawitter ccf575454e substrate version string can and can not contain additional strings (#1219)
* substrate version string can and can not contain additional strings

* make substrate version detection future proof^tm
2018-12-06 12:08:43 +01:00
Bastian Köcher 6caadd1968 Update rocksdb to try minimizing memory leaks (#1207)
* Update `rocksdb` to try minimizing memory leaks

* Update required dependencies
2018-12-05 13:54:13 +01:00
gabriel klawitter aab15230af .gitlab-ci.yml: update to include docker builds and publishing (#1209)
* .gitlab-ci.yml: update to include docker builds and publishing

* add Dockerfile for the ci
2018-12-05 18:44:04 +09:00
Robert Habermeier 9bccc9661c CheckInherentError can now report when something would be valid (#1204)
* CheckInherentError can now report when something would be valid

* set timestamp inherent to next valid block time

* return max timestamp for valid-after when checking
2018-12-04 09:19:36 +01:00
Afri Schoedon 93b212d2cc docs: typo and formatting fixes in code of conduct and contributors guidelines (#1197)
* docs: fix link in code of conduct

* docs: fix typo in contrib guidelines
2018-12-04 10:59:52 +09:00
Luke Schoen 59e1801ca1 docs: (#1200)
Fixes ordering of command-line arguments. `substrate --help` shows usage as substrate `[FLAGS] [OPTIONS] [SUBCOMMAND]`, where `--chain=staging` is one of the possible OPTIONS, and `build-spec` is a possible SUBCOMMAND.
The ordering should be `substrate --chain=staging build-spec` instead.

Relates to issue raised by user attente in Riot https://matrix.to/#/!HzySYSaIhtyWrwiwEV:matrix.org/$154385734133299JuBZU:matrix.parity.io
2018-12-03 20:29:46 +01:00
Robert Habermeier 63980e3770 make block builder and construct_runtime! generic over inherent-data (#1191)
* make block builder generic over inherent-data

* construct_runtime has you specify inherent data type

* get all tests to compile
2018-12-03 11:49:30 +01:00
Bastian Köcher 69a288e586 Cleanup the cli interface (#1194)
Parameters like `--dev`, `--base-path` or `--chain` were replicated
for each subcommand and were also present in the "top". This pr removes
these parameters from the subcommands.
The subcommands also ignored stuff like `--dev` as it was only read in
the top matcher, that did not look into the subcommand matchers.
Now, if you specify one of the parameters for a subcommand, you will get
an error instead of silently ignoring it.
2018-12-03 10:16:06 +01:00
Bastian Köcher af918ce556 Make sr-api-macros require at least syn-0.15.22 (#1195) 2018-12-03 10:15:41 +01:00
Robert Habermeier 40e6c7522a make start_aura bounds more lenient (#1189) 2018-12-03 02:47:09 +01:00
Andrew Jones c36998aeaf Default boot_nodes to local node in build-spec (#1181)
* Default to local bootnode with build-spec

* Rexport libp2p stuff via network crate

* Remove unused imports and fix where formatting

* Remove spurious blank lines

* Remove unnecessary else clause
2018-12-01 16:47:40 +08:00
Drew Stone 2327b213e2 Implement macro for session change trait over arbitrary tuples (limit 19) (#1177)
* Implement macro for session change trait

* Consolidate tuple macro into one
2018-11-30 17:26:24 +01:00
Bastian Köcher 1dc56b48ab Make AuthorityId serialize/deserialize to/from ss58 (#1180)
* Make `AuthorityId` serialize/deserialize to/from `ss58`

* Updates the wasm files
2018-11-30 16:52:48 +01:00
Bastian Köcher ed421c56ee Rewrite impl_runtime_apis! and decl_runtime_apis! as proc-macro (#1174)
* Rewrites `impl_runtime_apis!` macro as `proc-macro`

* Adds some documentation

* Require the `impl_runtime_apis` to use a path for accessing the trait

* Make the runtime implement `GetNodeBlockType`

* Moves first chunk of runtime api code into the `impl_runtime_apis` macro

This also renames `ClientWithApi` into `RuntimeApi`.

* Make `impl_runtime_apis` use `runtime` api version automatically

* `decl_runtime_apis` automatically adds `Block: BlockT` as generic parameter

* Remove function generic arguments in block builder api

* Remove some unnused stuff from the `decl_runtime_apis` macro

* Make `InherentData` working again

* Make `impl_runtime_apis!` implement the `RuntimeApi` side as well

* Make it compile again after rebasing with master

* Split `sr-api-macros` into multiple files

* Reimplement `decl_runtime_apis!` as proc_macro

* Use `decl_runtime_apis!` for `Core` as well and improve error reporting

* Adds documentation for `decl_runtime_apis!` and `impl_runtime_apis!`

* Move some code

* Adds compile fail tests

* Adds a test and fixes some bugs

* Make `impl_runtime_apis!` support `_` as parameter name

* Fixes build errors with wasm

* Wasm rebuild after master rebase

* Apply suggestions from code review

Co-Authored-By: bkchr <bkchr@users.noreply.github.com>

* Addresses some grumbles

* Adds test to ensure that method signatures need to match

* New wasm files
2018-11-30 11:42:46 +01:00
Guanghua Guo 309f627d5c Delete unused extern (#1178) 2018-11-30 07:27:30 +01:00
Benjamin Kampmann c27c613445 Remove Proposer from Service (#1171)
* Remove Proposer from Service

Refs #1021, #1158
2018-11-27 17:22:28 +01:00
Guanghua Guo 9ee6bdd203 Misspelled words (#1169) 2018-11-27 10:56:54 +01:00
Benjamin Kampmann 52e36bbeb8 Clean up CLI params (#1165)
* Fix params: they are kebab not snake-cased
* Fix docs missing in cli
* remove unsed macro-use
2018-11-27 09:25:27 +01:00
Benjamin Kampmann dbe31230c3 Simplify consensus message sending (#1166)
* Create gossip_consensus_message helper on service, simplify consensus_gossip access
2018-11-27 09:06:58 +01:00
Robert Habermeier 59af4de4fd GRANDPA: add commit messages (#1151)
* get compiling with latest version of grandpa

* generalize UntilImported to prepare for waiting for commit message targets

* extract until_imported out to own module

* logic for blocking commits until enough blocks imported

* add tests for commit message blocking logic

* pass through commit mesage round number as well

* extract communication streams to own module

* add Error implementation for ExitOrError

* introduce stream adapter for checking commit messages

* output sink for commits

* implement the unimplemented

* remove extra line

* update to latest version of grandpa api

* update finality-grandpa to 0.4.0

* Use filter_map earlier when checking incoming commits messages

Co-Authored-By: rphmeier <rphmeier@gmail.com>

* address some grumbles
2018-11-26 16:24:26 +01:00
André Silva b7e0db725d core, node: use grandpa block import for locally sealed aura blocks (#1167)
* core, node: use grandpa block import for locally sealed aura blocks

* core: impl DerefMut for FullComponents

* node: take grandpa_import_setup from service config
2018-11-26 15:29:13 +01:00
Svyatoslav Nikolsky 675c3b0500 fix purge-chain cli option (#1164) 2018-11-26 10:58:09 +01:00
Robert Habermeier 2e41e9e870 add leaves function to chain (#1154) 2018-11-23 02:35:01 +01:00
Bastian Köcher 41aec063df Make grandpa export its calls (#1153) 2018-11-22 17:13:43 +01:00