Commit Graph

80 Commits

Author SHA1 Message Date
Gav Wood 28b1cecf2f Runtime dispatch calls return Result (#192)
* Merge remote-tracking branch 'origin/master' into gav-xts-dont-panic

* Update wasm.

* consensus, session and staking all panic-safe.

* Democracy doesn't panic in apply.

* Fix tests.

* Extra helper macro, council depanicked.

* Fix one test.

* Fix up all council tests. No panics!

* Council voting depanicked.

* Dispatch returns result.

* session & staking tests updated

* Fix democracy tests.

* Fix council tests.

* Fix up polkadot parachains in runtime

* Fix borked merge
2018-06-01 18:32:40 +02:00
Tomasz Drwięga 59adb4767b Extrinsic pool (#182)
* Use latest version of txpool.

* Initial version of the pool.

* Fix abstraction.

* Implement watchers and notifications.

* Return hash from RPC.

* Remove commented code.

* Remove client dep.

* Fix tests.
2018-05-31 22:49:17 +02:00
Gav Wood 1b997de958 Public extrinsic apply doesn't panic (#178)
* Merge remote-tracking branch 'origin/master' into gav-xts-dont-panic

* Update wasm.

* consensus, session and staking all panic-safe.

* Democracy doesn't panic in apply.

* Fix tests.

* Extra helper macro, council depanicked.

* Fix one test.

* Fix up all council tests. No panics!

* Council voting depanicked.

* utilise hygene
2018-05-31 22:11:09 +02:00
Gav Wood b58ed7ee87 Balance is 128-bit value (#162)
* Replace 128-bit shim with real type.

* Remove unneeded code.

* Remove superfluous deps

* Reinstate deps.
2018-05-29 13:48:01 +02:00
Gav Wood 72eaf324a4 RPCs for versioning (#175)
* RPCs for versioning.

* Build fix for bad merge.

* Add system_name RPC

* Fix tests.

* Fix demo build.

* Remove BadFormat.
2018-05-29 09:58:48 +01:00
Svyatoslav Nikolsky fa642cf01a Preparing light client structure [v2] (#150)
* light client structure + remote call requests
2018-05-28 10:27:59 +03:00
Wei Tang ab7eae6f88 Update transaction-pool dependency and remove ethereum-types (#174) 2018-05-26 12:14:47 +01:00
Robert Habermeier c473c0c734 Minimal parachain framework part 1 (#113)
* dynamic inclusion threshold calculator

* collators interface

* collation helpers

* initial proposal-creation future

* create proposer when asked to propose

* remove local_availability duty

* statement table tracks includable parachain count

* beginnings of timing future

* finish proposal logic

* remove stray println

* extract shared table to separate module

* change ordering

* includability tracking

* fix doc

* initial changes to parachains module

* initialise dummy block before API calls

* give polkadot control over round proposer based on random seed

* propose only after enough candidates

* flesh out parachains module a bit more

* set_heads

* actually introduce set_heads to runtime

* update block_builder to accept parachains

* split block validity errors from real errors in evaluation

* update WASM runtimes

* polkadot-api methods for parachains additions

* delay evaluation until candidates are ready

* comments

* fix dynamic inclusion with zero initial

* test for includability tracker

* wasm validation of parachain candidates

* move primitives to primitives crate

* remove runtime-std dependency from codec

* adjust doc

* polkadot-parachain-primitives

* kill legacy polkadot-validator crate

* basic-add test chain

* test for basic_add parachain

* move to test-chains dir

* use wasm-build

* new wasm directory layout

* reorganize a bit more

* Fix for rh-minimal-parachain (#141)

* Remove extern "C"

We already encountered such behavior (bug?) in pwasm-std, I believe.

* Fix `panic_fmt` signature by adding `_col`

Wrong `panic_fmt` signature can inhibit some optimizations in LTO mode.

* Add linker flags and use wasm-gc in build script

Pass --import-memory to LLD to emit wasm binary with imported memory.

Also use wasm-gc instead of wasm-build.

* Fix effective_max.

I'm not sure why it was the way it was actually.

* Recompile wasm.

* Fix indent

* more basic_add tests

* validate parachain WASM

* produce statements on receiving statements

* tests for reactive statement production

* fix build

* add OOM lang item to runtime-io

* use dynamic_inclusion when evaluating as well

* fix update_includable_count

* remove dead code

* grumbles

* actually defer round_proposer logic

* update wasm

* address a few more grumbles

* grumbles

* update WASM checkins

* remove dependency on tokio-timer
2018-05-25 16:16:01 +02:00
Gav Wood 59e8adb604 Introduce 128-bit shim for u128/i128 and use it for Balance (#163)
* Add 128-bit shim and use for balance.

* Fix tests.

* Fix wasm build.
2018-05-24 16:24:09 +02:00
Sergey Pepyakin bc3242ca77 Contracts: Memory and Module instance teardowns (#171)
* Add teardowns.

* Rebuild binaries.
2018-05-24 13:18:55 +01:00
Sergey Pepyakin dcbc0f759e Contracts: Make Balance Slicable. (#168)
* Make Trait::Balance: Slicable

* Rebuild binaries.
2018-05-23 16:03:54 +01:00
Sergey Pepyakin 912a4dcbdd Smart-contract inspection and instrumentation. (#165)
* Extract mock module.

* Wasm smart-contract instrumentation

* Rebuild binaries.

* Memory limits and tests.
2018-05-23 13:45:57 +02:00
Robert Habermeier ef8d2b4d4b install wasm-gc using nightly (#167) 2018-05-17 14:26:11 +02:00
Robert Habermeier 748238eb40 Archive Mode and groundwork for state-preserving handles (#166)
* less eager deletion of DB values

* archive mode
2018-05-17 13:47:53 +02:00
Robert Habermeier 0fa049b0c7 Store trie nodes in DB (#157)
* move responsibility of storage_root calculation to state backend

* have `storage_root` produce a memoizable transaction

* store trie nodes in kvdb

* fix up test fallout

* remove stray newline

* Fix comment

* test for setting and checking state data

* fiddle with dependencies

* all parity deps on same commit hash

* fix network protocol registration
2018-05-16 16:56:24 +02:00
Robert Habermeier 7c51525ad3 Hook RPC extrinsic import into propagation (#158)
* call `on_new_transactions` when we import

* fix trace

* pass correct bytes to network

* clean up

* cull before repropagating; repropagate on timer

* add a little tracing
2018-05-15 10:27:18 +02:00
Robert Habermeier 1283545b4b Fix sync: ensure block hash gets read from the DB correctly (#152)
* update bootnodes

* fix block_hash loading

* test block hash gets inserted correctly

* specify revision to pull kvdb-memorydb from

* update parity repo dep
2018-05-11 15:46:54 +02:00
Robert Habermeier 6a9292b71c update bootnodes (#151)
(insubstantial)
2018-05-09 18:42:49 +02:00
Robert Habermeier 54f5debf5d Ensure VoteAdvance messages propagate (#148)
* avoid clobbering accumulator state with late propose

* log state when polling

* trace on input messages
2018-05-09 12:25:17 +02:00
Svyatoslav Nikolsky 42d22cbb37 node-key cli option (#149) 2018-05-09 12:06:59 +02:00
Robert Habermeier ab946b2b9f Ensure all known BFT messages are imported when starting consensus (#147)
* a little more BFT tracing

* import cached BFT messages into the produced stream
2018-05-08 17:01:26 +02:00
Robert Habermeier f9d5a6a09f update wasm 2018-05-08 17:00:32 +02:00
Robert Habermeier 39d691821d More testnet fixes (#145)
* initialise dummy block before API calls

* test for random-seed

* revert polkadot-runtime changes
2018-05-08 14:55:21 +02:00
Gav Wood ff93bc2a79 Fixes and improvements for PoC-1 Testnet (#143)
* Fix initialisations and add a test.

* Fix test.

* Fix overflow bug.

* Minor refactoring and fixes.

* Fix vote threshold.

* Add note.

* Fixes for latest rust and the readme.

* Better readme.

* An extra validator for PoC-1

* Update README.

* PoC-1 bootnodes.

* don't return async::notready for messages without scheduling wakeup

* Fix endowed account

* give polkadot control over round proposer based on random seed

* address grumbles.
2018-05-07 15:25:47 +02:00
Robert Habermeier 353d9438c8 don't return async::notready for messages without scheduling wakeup 2018-05-06 13:25:37 +02:00
Arkadiy Paronyan 1fd21618d9 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 81f133f36d 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
Arkadiy Paronyan be23db6916 Improved logging (#138)
* Improved logging

* Removed some unwraps
2018-04-18 15:57:43 +02:00
Robert Habermeier 7f2c798a06 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 a3eec9362f 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 f57d0d8ba1 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 fd0d9a4dea 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 39f78aa7c4 prune finalized transactions from the pool (#127) 2018-04-15 12:53:53 +02:00
Robert Habermeier 2bafd5c0be Revert "prune finalized transactions from the pool"
This reverts commit 7ab024ceb65c31edcf6414f98a31dd7a29688c96.
2018-04-14 15:35:54 +02:00
Robert Habermeier f39bbd1c7f prune finalized transactions from the pool 2018-04-14 15:34:08 +02:00
Gav Wood 727df04e57 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 002cacd26c delay before voting on proposals (#123) 2018-04-12 16:35:48 +02:00
Robert Habermeier 1c5d6d59a7 kill post_finalise (#121)
* kill post_finalise

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

* Reinstate bail on unknown runtime.
2018-04-12 13:15:56 +02:00
Gav Wood 65489f1b19 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 9b0ef06cf8 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 e81229ae04 Basic informant (#118)
* Informant

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

* Recompile wasm.
2018-04-11 14:24:57 +02:00
Gav Wood 68273405a2 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 0e442f06e1 Bumped devp2p (#116) 2018-04-07 17:17:06 +02:00
Arkadiy Paronyan f532982623 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 6a99c9a43d 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 ef939ed2f6 Expose transaction pool from the polkadot service (#109) 2018-04-05 09:57:44 +02:00
Gav Wood e0d0fca201 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 5983a6654e 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