Commit Graph

75 Commits

Author SHA1 Message Date
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
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 bdf156d35e kill post_finalise (#121)
* kill post_finalise

* update wasm runtimes
2018-04-12 13:17:43 +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
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 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
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
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
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
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
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 62f3bee9c1 Public function dispatching. 2018-03-10 19:23:10 +01:00
Gav aadf3e2493 Tests for staking reserved balances & slashing. 2018-03-10 18:42:50 +01:00
Gav 8c0c504997 Use a struct! 2018-03-07 19:36:13 +01:00
Gav 3ad3288508 Genesis map.
- fix warning
- remove more bare string ids
2018-03-07 12:16:12 +01:00
Gav 19424ce2ce Introduce stake reservation; make panicking tests better. 2018-03-06 21:09:41 +01:00
Gav a3ad686760 Move democracy module over no new Keyring API 2018-03-06 17:37:53 +01:00
Gav c055012028 Move council over to new Keyring API. 2018-03-06 17:33:19 +01:00
Gav fb61e2db32 Final tests. 2018-03-06 16:21:27 +01:00
Gav d12eee1164 Another few tests for council_vote. 2018-03-05 15:58:06 +01:00
Gav 0ab638928d council vetoing & tests. 2018-03-05 15:50:40 +01:00
Gav 7d378d3de3 More tests for council voting.
Also allow AsRef to be used for Public keys to simplify test code.
2018-03-05 12:11:56 +01:00
Gav 8d84ca8b48 Initial council vote logic. 2018-03-04 21:52:11 +01:00
Gav f056dea47e Ensure council always sorted by expiry. 2018-03-04 20:55:14 +01:00
Gav f7af45f95b remove string constants <-- @rphmeier 2018-03-04 19:36:26 +01:00
Gav 650e30d39c Tests for public referenda. 2018-03-04 13:47:36 +01:00
Gav 311337f5dc Tests for public referenda. 2018-03-04 13:17:53 +01:00
Gav 6476f26815 Introduce minimum deposit 2018-03-03 19:30:07 +01:00
Gav e8d38add64 cleanups. 2018-03-03 19:04:42 +01:00
Gav cf81e1dbb6 Deposits, not fees. 2018-03-03 19:01:39 +01:00
Gav e07aef7766 Introduce logic for deposits. 2018-03-03 14:36:37 +01:00
Gav 6cf236fb02 Simultaneous referendums and multiple voting variants. 2018-03-03 11:26:56 +01:00
Gav f5515ff673 Update docs 2018-03-02 20:11:16 +01:00
Gav c298331c3d test: against double presentations. 2018-03-02 19:18:54 +01:00
Gav f0699b9c8d Avoid allowing same accounts to be doubly-elected. 2018-03-02 19:14:35 +01:00
Gav b611881e8f Add one vote worth of time for voters to unregister before they become "inactive". 2018-03-02 18:43:15 +01:00
Gav 36bd7f0608 Additional docs & test. 2018-03-02 18:11:03 +01:00
Gav 60697d4402 tests: Retract inactive voter 2018-03-02 18:02:20 +01:00
Gav a633a257ef Merge branch 'master' into gav-demo 2018-03-02 14:59:32 +01:00
Gav d034f647f7 cleanups. 2018-03-02 14:41:20 +01:00
Gav d247a2e2b3 tests: presenting losers 2018-03-02 14:40:36 +01:00
Gav 826a06fc23 Tests: various error cases with present. 2018-03-02 14:33:03 +01:00