Commit Graph

8915 Commits

Author SHA1 Message Date
cheme 23634b6b95 Include default values in storage metadata (#1264)
* Add a 'default' field to metadata. It contains code to generate the
default value.

* wasm update

* Make 'default' field an `Option`

* Boxed fn is not static, that won't be fine

* static fn won't do it to as it cannot get T param, will try fat trait

* Fat pointer over phantom data compatible with static instantiation

* DecodeDifferent is cool, using it for decoding.

* using once cell to do what would require copying lazy_static internals.

* Remove cache when no_std (non compatible deps)

* wasm bins update

* Fuse tooling struct and enum derive.
2018-12-20 14:31:03 +01:00
Mohanson 2742975169 Fix usage error in README (#1291)
* Fix usage error in README

* Flow the advice
2018-12-20 13:14:19 +01:00
cheme 9c8e3ffb52 Reformat types string for decl_storage (#1298)
* Clean space from types when converting to string

* Missing cases.

* Add unit test for complex type, complete clean fn.
2018-12-19 17:51:46 +01:00
Wei Tang 66ad1ed974 Avoid duplicate depencency declare via package re-export (#1287)
* node/runtime: Avoid duplicate dependency via package reexport

* core/test-runtime: Avoid duplicate dependency via package reexport

* Update lock file
2018-12-19 17:47:10 +01:00
Jaco Greeff d5749e878b Add additional Charred Cherry properties (#1286) 2018-12-19 17:45:12 +01:00
Tomasz Drwięga eba9d1e0a4 Don't call runtime if pool is empty. (#1283) 2018-12-19 12:21:46 +03:00
Gav Wood 0c32567c1c Version. 2018-12-17 19:02:01 +01:00
Gav Wood ac2c44f322 A new substrate-node testnet for 1.0beta (#1280)
* Add new testnet

* Rename

* Update lib.rs

* Rename ctd.

* Remove BBQ Birch Testnet reference from Readme

* Fix comment

* Update keys
2018-12-17 18:57:07 +01:00
Simon Littlejohns 1c104e0568 Consensus data added with generic use in service/src/consensus.rs. Th… (#1274)
* Consensus data added with generic use in service/src/consensus.rs. This may need to change.

* refactor consensus service a bit
2018-12-17 18:51:40 +01:00
Tomasz Drwięga c1b08cd9b0 Expose system health via RPC and REST (#1269)
* Implement health endpoint.

* Expose health API.
2018-12-17 11:19:24 +01:00
Bastian Köcher 090ca9ee7c Upgrade sysinfo to fix compilation on windows (#1267) 2018-12-17 11:10:50 +01:00
Sergei Pepyakin 39a2afc44f Update wabt to 0.7 (#1276) 2018-12-16 21:07:15 +01:00
André Silva 45d53ad022 Remove grandpa liveness oracle (#1271)
* core: support broadcasting consensus message to all peers

* grandpa: remove liveness oracle

* node: always start grandpa on full nodes

* core: don't check for grandpa justifications on failed block imports

* core: fix network connectivity test
2018-12-15 20:39:48 +01:00
Luke Schoen b2ce2f4bd9 Update SRML Assets: add total supply query, refactor with specific tests (#1185)
* Update SRML Assets: add total supply query, refactor with specific unit tests, update assertions

* Add feature and tests to allow querying total supply

* Add assertion and tests to ensure that transfer amount is greater than or equal to one unit

* Replace broad `it_works` function test with various specific unit tests

* Fix `destroy` function by moving assertion before the action

* Fix typos `Transfered` should be `Transferred`, `requried` should be `required`

* Reference: https://hackmd.io/nr6kPD2sR4urmljtvHs0CQ?view#Assets-Module

* refactor: Order imports alphabetically

* review-fix: Replace non-zero check with shorter equivalent

* review-fix: Restore order of non-zero assertion and destroy account

* Update lib.rs
2018-12-14 08:32:59 +01:00
Gav Wood 27f69def9a Lock-voting (#1254)
* Optionally long lock voting

* Lock voting.

* Fix tests

* Comment update

* Comments

* Minor grumbles

* Docs.
2018-12-13 18:58:50 +01:00
Sergei Pepyakin 025bcdda0f srml-contract: ext_caller follow-up (#1266)
* s/account ID/address

* Add a note about CODE_CALLER

* Comment tests.
2018-12-13 18:20:40 +01:00
Svyatoslav Nikolsky 81f90ed0a4 AuxStore on light clients (#1251)
* implement AuxStore on light clients

* Update core/client/db/src/light.rs

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

* Update core/client/db/src/light.rs

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

* Update core/client/db/src/light.rs

Co-Authored-By: svyatonik <svyatonik@gmail.com>
2018-12-13 17:01:57 +01:00
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