Commit Graph

468 Commits

Author SHA1 Message Date
Arkadiy Paronyan 04cbcd0655 Database backend (#133)
* DB backend

* DB backend

* Cleanup

* Clean build files after running tests

* Fixed comment

* add OOM lang item to runtime-io
2018-05-02 13:36:36 +02:00
Sergey Pepyakin 5a56fbcea3 Sandboxing and the simplest smart-contract runtime (#140)
* Add primitives for sandboxing.

* Add sandbox module.

* Implement the runtime part of the sandbox.

* Rebuild binaries.

* Implement smart-contract execution.

* Add more documentation.
2018-05-01 20:32:01 +02:00
Tomasz Drwięga f116f67382 Substrate test client crate & chain subscription test (#139)
* Test client used in RPC tests.

* Use test-client for network tests.

* Expose BlockOrigin and clean up the API.
2018-05-01 16:39:55 +02:00
Arkadiy Paronyan 101549238e Improved logging (#138)
* Improved logging

* Removed some unwraps
2018-04-18 15:57:43 +02:00
Robert Habermeier b6132800b7 handle exit and avoid threads hanging (#137)
* barrier on starting network

* handle exit better

* give consensus service its own internal exit signal

* update comment

* remove stop_notifications and fix build
2018-04-18 13:59:46 +02:00
Tomasz Drwięga e253a4cb9f Chain head subscription (#126)
* Start WebSockets server.

* Expose non-working subscription.

* Dummy subscription for testing.

* Proper implementation with event loop.

* Finalized pubsub.

* Bump clap.

* Fix yml.

* Disable WS logs.

* Remove stale TransactionHash mention

* Fix build from nightly API change.

* Don't panic on invalid port.

* Bind server to random port.

* Send only best blocks.
2018-04-17 13:03:57 +02:00
Gav Wood eb6d142846 Ensure authorities don't disappear after block 50 (#132)
* Disable CORS validation, improve logging.

* Fix build from nightly API change.

* Rebuilt binaries

* More logs, keep validators after 50 blocks.
2018-04-16 15:34:46 +02:00
Gav Wood 8ff246eb8a Disable CORS validation, improve logging, fix build on nightly. (#129)
* Disable CORS validation, improve logging.

* Fix build from nightly API change.

* Rebuilt binaries
2018-04-16 14:23:33 +02:00
Robert Habermeier 40c7820c31 ensure proposal evaluation occurs at most once per round (#125)
* ensure proposal evaluation occurs at most once per round

* add test

* remove println
2018-04-15 13:23:59 +02:00
Robert Habermeier 2a53d414a3 prune finalized transactions from the pool (#127) 2018-04-15 12:53:53 +02:00
Robert Habermeier 6e945e40ee Revert "prune finalized transactions from the pool"
This reverts commit 0b59c1bfb9.
2018-04-14 15:35:54 +02:00
Robert Habermeier 0b59c1bfb9 prune finalized transactions from the pool 2018-04-14 15:34:08 +02:00
Gav Wood 808d762158 Add chain RPCs and getHeader. (#124)
* Add chain RPCs and getHeader.

Also:
- finish renaming transaction -> extrinsic;
- rejig development chain spec to be more useful.

* Fix.

* Remove invalid comments.

* Fix.
2018-04-13 14:21:32 +02:00
Robert Habermeier e9cdd45145 delay before voting on proposals (#123) 2018-04-12 16:35:48 +02:00
Robert Habermeier bdf156d35e kill post_finalise (#121)
* kill post_finalise

* update wasm runtimes
2018-04-12 13:17:43 +02:00
Gav Wood 46e3c32e49 Add --chain option. (#122)
* Add --chain option.

* Reinstate bail on unknown runtime.
2018-04-12 13:15:56 +02:00
Gav Wood 1972d612fa Extrinsics root is calculated as part of block-building (#120)
* extrinsics root is calculated as part of block-building.

* Fix build.

* Fix xt root.

* Couple of fixes.

* Logging and more useful APIs.

* Fix test.

* Update log version.

* Switch back to correct version of log.
2018-04-12 12:18:43 +02:00
Arkadiy Paronyan 54d6970efc Fixed block proagation after import and import notifications (#119)
* Fixed block proagation after import and import notifications

* Removed cargo check
2018-04-11 19:25:41 +02:00
Arkadiy Paronyan d978425f05 Basic informant (#118)
* Informant

* Pass Handle instead of Core
2018-04-11 16:47:22 +02:00
Sergey Pepyakin 052c50b536 Refactor Externalities to AccountDb. (#112)
* Refactor Externalities to AccountDb.

* Recompile wasm.
2018-04-11 14:24:57 +02:00
Gav Wood 3024a839f2 Transaction queue integration + submission RPC (#99)
* Implement transaction queue RPC.

* whitespace

* Support without_std env in environmental!  (#110)

* Make environmental crate support without_std env.

* Small doc fixes.

* Remove dead code.
2018-04-09 16:28:06 +02:00
Arkadiy Paronyan f72e9e7e13 Bumped devp2p (#116) 2018-04-07 17:17:06 +02:00
Arkadiy Paronyan b3dd4e74fd Consensus message buffering and more (#114)
* CLI options and keystore integration

* Replace multiqueue with future::mpsc

* BFT gossip

* Revert to app_dirs

* generate_from_seed commented

* Refactor event loop

* Start consensus by timer

* Message buffering

* Minor fixes

* Work around duty-roster issue.

* some more minor fixes

* fix compilation

* more consistent formatting

* make bft input stream never conclude

* Minor fixes

* add timestamp module to executive

* more cleanups and logging

* Fixed message propagation
2018-04-06 19:18:26 +02:00
Sergey Pepyakin 633b9f4c0b Support without_std env in environmental! (#110)
* Make environmental crate support without_std env.

* Small doc fixes.
2018-04-05 17:23:43 +02:00
Gav Wood 1d8a9a6dd3 Make Polkadot use the Substrate traity libraries (#105)
* Initial stuff.

* Various fixes.

* Fix tests.

* Fix another test

* Fix another test.

* Docs in polkadot runtime.

* Fix up ser/de tests.

* Update god keys

* Syntax

* Fix

* Merge remote-tracking branch 'origin/master' into gav-merge-runtime

* Permissions on init.sh

* Port-over the whitespace from @rphmeier

* Rename

* Merge branch 'master' into gav-merge-runtime

* Fix typo.

* Fix grumbles.

* Make more idiomatic.

* Move `Ed25519Signature` out of traits.
2018-04-05 17:13:12 +02:00
Arkadiy Paronyan 6b83f11a11 Expose transaction pool from the polkadot service (#109) 2018-04-05 09:57:44 +02:00
Sergey Pepyakin b0d8eeb526 Migrate from parity-wasmi to wasmi. (#103) 2018-04-04 21:39:41 +02:00
Gav Wood bd066e27a6 Traitify Runtime (#104)
* Factor out safe-mix and dispatch

* Refactor dispatch into something more modular.

* Fix wasm build.

* Fix up timestamp

* fix warnings.

* Borked timestamp example

* Fix build

* Timestamp as skeleton for traity runtime.

* New storage macro.

* Dispatch module has traity API.

* Move consensus module to new API

* Refactoring and outer dispatch

* Avoid unnecessary derives.

* Abstract the low-level half of system.

* nicer outer dispatch syntax.

* Make runtime compile again (albeit in a heavily simplified state)

* Reworking runtime and the upper levels of system.

* Initial reworking of runtime:

- Introduced executive module;
- Introduced trait primitives module;
- Provided an API endpoint.

* Expose an additional function in system

* Another couple of functions traitified in executive.

* another function in executive traitified.

* One more function traitified.

* Finish traitifying executive!

* Traitify session module.

* Cleanups and ensure session gets run.

* First part of traitification of staking module.

* Bit more of staking traitified.

* Additional stuff in staking. Fix up session.

* Penultimate part of staking module.

* Final part of staking (code)

* Update demo runtime to include staking.

* Final tweaks for staking integration.

* Remove old runtime files.

* Schedule staking.

* Minor fixes

* First bits of democracy.

* Democracy module integrated.

* Fix warning.

* Traitify and integrate council module

* Council voting.

* Runtime binary and tweaks.

* Binary update.

* Fix `*Type` grumble.

* Fix up genesis_map

* Remove NonTrivialSlicable

* Staking "test externalities" stuff along with refactor.

* Add session test externalities constructor

* Fixed executor tests.

* Make one test in executive module work.

* Remove test framework stuff into common module.

* Enable other tests in executive

* Session tests reinstated, minor refactoring of keyring.

* Fix staking tests.

* Fix up democracy tests.

* First few tests in council.

* Council tests reinstated :)

* Avoid hardcoding blake2 into Header.

* Fix last few tests.

* Make all primitives generic.

* Fix tests.

* Refactor runtime to remove genesismap.

* Streamline runtime more with macrofied config.

* Clean paths

* Fix warning.

* Consolidate demo runtime crate.

* Remove stale code.

* Refactor away dodgy trait.

* Add corresponding Aux type.

* Fixes

* Rename Digesty -> Digest

* Rename Headery -> Header

* Blocky -> Block

* Fix wasm build.

* kill warnings

* more docs

* minor cleanups
2018-04-04 12:06:39 +02:00
Arkadiy Paronyan 3ec6d2dde6 BFT gossip (#106)
* CLI options and keystore integration

* Replace multiqueue with future::mpsc

* BFT gossip

* Revert to app_dirs

* generate_from_seed commented
2018-04-03 18:06:34 +02:00
Robert Habermeier 5fad9efc0a add delay test (#107) 2018-04-03 13:25:21 +02:00
Arkadiy Paronyan 471761f4b6 Polkadot service (#82)
* Block import notifications

* Build fix

* Consensus messages supported in the networking

* Started consensus service

* BFT service

* Transaction propagation

* Polkadot service

* CLI integration

* Build fix

* Added signatures validation

* Removed executor argument

* Refactored steam loops; Queue size increased

* Limit queue size

* Fixed doc comment

* Fixed wasm build

* Fixed wasm build

* Check id properly
2018-03-30 13:54:37 +02:00
Sergey Pepyakin 96fb93b09c Fix wasm build (#102)
* Reserve pages for heap at initialization time

Since it is freshly allocated memory it won't collide with stack, data or whatever else.

* Compile all wasm files with LTO.

Modules compiled without LTO contain undesired imports and outright invalid (e.g. type mismatches inside the wasm).
2018-03-21 15:44:14 +08:00
Gav Wood ad552cba4b A random beacon (#96)
* Completely rework dispatch mechanism into something modular.

Not yet complete but 75% there.

* Council vote tests.

* Fix tests.

* whitespace.

* Fix demo runtime tests.

* Fix up tests.

* Remove dead code.

* Initial util code for random beacon

* Timestamp uses new storage API.

* Move over system module to new API.

* Much nicer storage API, moved over staking module.

* More refactoring.

* Democracy uses new storage API.

* Council uses new RPC.

* Fix more tests.

* Use match for Id

* Generic mix.

* Integrate random beacon

* Update binaries.

* Fixes relating to with_ext removal.

* Remove dead code.

* Rework mixer into an iterator adaptor.

* Link to paper.

* Algorithm cleanups

* Merge and fix test.

* Docs.

* Fix typo.

* rename

* Fix tests.
2018-03-20 10:48:11 +08:00
Gav Wood 1ecd05dac9 Refactor all (demo) runtime modules to use new storage (#98)
* Completely rework dispatch mechanism into something modular.

Not yet complete but 75% there.

* Council vote tests.

* Fix tests.

* whitespace.

* Fix demo runtime tests.

* Fix up tests.

* Remove dead code.

* Timestamp uses new storage API.

* Move over system module to new API.

* Much nicer storage API, moved over staking module.

* More refactoring.

* Democracy uses new storage API.

* Council uses new RPC.

* Fix more tests.

* Use match for Id

* Use match for Id

* Make PrivPass better protected.

* Address other grumbles.

* Give PrivPass a private member.

* Testing PrivPass.

* Add docs.

* Recompile binaries after merge.

* Remove duplicated code.

* New binaries.

* Docs

* Docs

* avoid use of (arguably) confusing terminology.
2018-03-19 06:38:20 +01:00
Gav Wood f35763cc86 Modularised dispatch (#95)
* Completely rework dispatch mechanism into something modular.

Not yet complete but 75% there.

* Council vote tests.

* Fix tests.

* whitespace.

* Fix demo runtime tests.

* Fix up tests.

* Remove dead code.

* Use match for Id

* Make PrivPass better protected.

* Address other grumbles.

* Give PrivPass a private member.

* Testing PrivPass.

* Add docs.
2018-03-19 03:51:50 +01:00
Robert Habermeier c1d4ae5a53 KeyStore implementation + key derivation (#97)
* improve ed25519 bindings

* probably broken child derivation

* basic keystore

* keystore integration in CLI

* constant-time mac comparison

* fix spaces
2018-03-16 17:39:49 +01:00
Robert Habermeier 68515bd9ff runtime-storage macro (#86)
* initial draft of the macro

* traits for all storage types

* test for list wrapper

* map API

* move generator to runtime-support

* specialize traits further for runtime storage

* restore storage vec for unhashed
2018-03-14 15:39:51 +01:00
Arkadiy Paronyan 5cc8cf7d70 Merge pull request #79 from paritytech/gav-demo
Substrate demo (a basic blockchain made with substrate)
2018-03-14 12:56:36 +01:00
Gav 75002884fe Update wasm. 2018-03-14 12:44:15 +01:00
Gav 0744e5a9a3 Merge branch 'master' into gav-demo 2018-03-14 12:03:44 +01:00
Gav c64d4980b4 Remove stray printlns. 2018-03-14 11:58:03 +01:00
Robert Habermeier 27c9e6de9a Slash Authorities for irrefutable misbehavior (#84)
* double-commit and prepare misbehavior

* get misbehavior on completion

* collect misbehavior on drop, not only on success

* kill unused transaction_index field

* add primitive misbehavior report type

* add misbehavior report transaction

* store prior session

* fix set_items

* basic checks for misbehavior reports

* crate for substrate bft misbehavior checking

* integrate misbehavior check crate

* fix comment

* new wasm binaries

* fix hash in test

* import misbehavior transactions into queue

* fix test build

* sign on digest and full proposal when proposing

* detect proposal misbehavior

* fix fallout

* restore balance/bondage types
2018-03-13 16:39:27 +01:00
Gav df4edb507e Formatting. 2018-03-12 16:43:58 +01:00
Gav f9dd7093f1 Additional function ids for derivation. 2018-03-12 10:52:05 +01:00
Gav 550ec8cdf5 Cleanups and introduce all dispatchable endpoints. 2018-03-12 10:15:30 +01:00
Gav 873b579726 Minor typos. 2018-03-11 17:30:25 +01:00
Gav 80a95d843c Fix grumbles. 2018-03-11 17:27:59 +01:00
Gav 13bc601c14 Fix tests and avoid use of old keys. 2018-03-10 19:28:56 +01:00
Gav 4ad8b95d61 Safe panic. 2018-03-10 19:23:38 +01:00
Gav 62f3bee9c1 Public function dispatching. 2018-03-10 19:23:10 +01:00