Commit Graph

1166 Commits

Author SHA1 Message Date
Shawn Tabrizi c4010edb75 Updating parking_lot dependencies to 0.7.1 (#1361) 2019-01-08 11:15:42 +01:00
Wei Tang 71d889b692 Make AuthorityId generic (#1296)
* BlockAuthorityId convenience type

* Rename AuthorityId -> Ed25519AuthorityId to make it more precise

* Generalize AuthorityId up to substrate-client

* Fix in client-db

* rename: BlockAuthorityId -> AuthorityIdFor

* typo: should be digest item

* Fix test-runtime authorityId mismatch

One states that AuthorityId is u64 while the other states that it's Ed25519AuthorityId.

* Fix more u64 - Ed25519AuthorityId mismatch

* Fix compile of most of the srml modules

* Continue to pin aura and grandpa with ed25519 and fix compile

* Add MaybeHash trait

* Fix node-runtime compile

* Fix network tests
2019-01-08 11:14:18 +01:00
Gav Wood 043831cfb0 Invulnerabiity from slashing for certain validators (#1355)
* Invulnerabiity from slashing

* Update srml/staking/src/lib.rs

Co-Authored-By: gavofyork <github@gavwood.com>
2019-01-07 16:07:58 +01:00
cheme d271a4647c Decl_storage macro : force traits. (#1317)
* Missing trait def on two calls.

Slight mcla refact on transfo.

* Allways provide GenesisConfig even when useless (for runtime module
export).

* Revert "Allways provide GenesisConfig even when useless (for runtime module"

This reverts commit 84a29bc592023d1ee107519c58693ec19dbde2d2.

* Fix Vec usage (from rstd).
2019-01-07 16:05:47 +01:00
Wei Tang f5c4abd0f3 Use primitive-types crate to unify Parity Ethereum primitives (#1187)
* Unify primitive types with parity-ethereum

* Update primtive-types patch version

* Fix merge issue

* Add necessary fixed-hash features

* Fix node-primitives compile

* Reexport impl_serde::serialize as bytes to avoid path changes
2019-01-07 15:54:59 +01:00
Luke Schoen cb52401350 Update SRML Council: prevent excess votes/computation (#1162)
* fix: Add assertions to prevent excess votes and computation, and to end council seat election when no empty seats

* Add assertion to prevent a vote from voters that provide a list of votes that exceeds the desired seats length, since otherise an attacker may be able to submit a very long list of `votes` that far exceeds the amount of candidates and waste more computation than a reasonable voting bond would cover. Added additional associated test that may be run with `cargo test -p srml-council`

* Add assertion so expired council seats are not up for election when desired seat count changes during the voting period such that there are no longer any empty seats

* Update comment to refer to `reporter` instead of `who` (target of inactivity), since the origin is the `reporter`

* Update commment to refer more specifically to how many vote indexes, since `InactiveGracePeriod` is measured in vote indexes

* Update comment for `ApprovalsOf` since previously the comment was a duplicate of the comment for `LastActiveOf`'s

* Create variable to refer to `retaining_seats` to improve readability

* Reference Notes: https://hackmd.io/nr6kPD2sR4urmljtvHs0CQ

* WIP - length votes should be less than length candidates. pushing changes for reference so can fix

* fix: Amount of candidate approval votes cannot exceed candidates amount. Candidates amount must be over zero.

* Fix so that amount of candidate approval votes cannot exceed amount of candidates (instead of desired seats)

* Add assertion to `set_approvals` such that amount of candidates to receive approval votes must be greater than zero. Add associated test

* fix: Remove assertion preventing votes when empty seats is 0

* review-fix: Replace with is_zero and add corresponding test

* Update seats.rs

* Update seats.rs
2019-01-07 15:53:37 +01:00
Robert Habermeier eb0ff291d6 log on reorganization (#1356) 2019-01-07 15:32:04 +01:00
Aton 409d495b42 fix bug for revert (#1341)
* must pass sub_matches to function, so that could get `<num>` in revert
* revert should del current best index block, not prev block
2019-01-07 10:17:05 +01:00
Arkadiy Paronyan 8948567c23 Fixed ancestry search/block queue interaction (#1337)
* Fixed ancestry search - block queue interaction

* Style
2019-01-06 16:45:41 +00:00
Shawn Tabrizi 5db38433c2 Small update to documentation of construct_runtime! (#1353)
Documentation says the `default` macro expands to `Module, Call, Storage, Event<T>, Config`, but it actually uses the generic config: `Module, Call, Storage, Event<T>, Config<T>`
2019-01-06 16:44:52 +00:00
André Silva 468fd19f6b Improve ondemand request dispatch (#1349)
* core: fix bug on ondemand dispatch

after a request was dispatched to the last peer the dispatch would loop
forever on subsequent requests that aren't able to be fulfilled by any
of the peers, since the last peer wasn't updated.

* core: try to dispatch all pending ondemand requests
2019-01-06 16:43:51 +00:00
Wei Tang ac1be0665e Support custom fork choice rule (#1339)
* Support custom fork choice rule

* Remove unneeded reexport

* Fix network compile
2019-01-04 20:34:58 +01:00
Gregory Terzian 771a8127c2 moving core/service/consensus into new core/authorship crate (#1257) 2018-12-31 12:33:49 +01:00
Gregory Terzian 3add75910a move import queue to consensus-common (#1282) 2018-12-31 12:33:21 +01:00
Robert Habermeier 35ba22cdd1 refactor aura slot timers a bit, add additional guards (#1303) 2018-12-29 15:29:09 +01:00
Arkadiy Paronyan 831fd9947f Make sure displaced leaves are removed from the db (#1338) 2018-12-29 14:08:20 +01:00
toxotguo 236208b6cb fix pruning arg type (#1332) 2018-12-27 13:35:05 +01:00
kyegupov 11f77464fb Improved test for conditional panic (#1320) 2018-12-23 20:22:45 +01:00
Bastian Köcher d15cc63370 Make deposit_event work with none generic events (#1309)
* Make `deposit_event` work with none generic events

`fn deposit_event() = default` will now be used for none generic events
`fn deposit_event<T>() = default` is now for generic events.

* Update wasm files

* Fixes some spelling mistakes

* Update wasm and fix new module
2018-12-22 17:37:05 +01:00
Wei Tang 031826ebdb typo: Hash -> Self::Hash (#1319) 2018-12-22 17:35:49 +01:00
André Silva f8f932d123 node: fix shutdown (#1308)
* node: remove grandpa authority flags

* node: exit-guard grandpa and aura spawned futures

* node: wait for futures to stop running on shutdown

* core: run connectivity tests on same ports

* core: pass on_exit future when starting aura and grandpa

* node: add issue number to todo

* core: fix aura and grandpa tests
2018-12-21 17:30:45 +01:00
Gav Wood ef8b94656e Sudo module (#1315)
* Sudo module

* Fix comment

* Fix errors

* Fix test

* Update hashes

* Final test fixes and build

* Final hex change
2018-12-21 13:43:34 +01:00
André Silva d67821a580 node: remove grandpa authority flags (#1306) 2018-12-21 12:56:18 +01:00
Gav Wood a6c77e4f82 Compact extrinsics (#1314) 2018-12-21 12:55:44 +01:00
Gav Wood 353a87732d Bump to v0.9.1 (#1307) 2018-12-20 20:30:54 +01:00
Arkadiy Paronyan 0c4ae551e5 Fixed common block tracking on new block announcement (#1305) 2018-12-20 18:34:19 +01:00
Tomasz Drwięga 71343248ca Call a state before block was imported. (#1294)
* Call a state before block was imported.

* Add test to check if it works correctly.
2018-12-20 15:28:14 +01:00
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