Commit Graph

4702 Commits

Author SHA1 Message Date
Sergey Pepyakin 68e468f59c Use #[panic_implementation] attribute that was landed in the recent nightly (#199)
* Use [panic_implementation] instead of lang item

* Rebuild binaries.
2018-06-04 19:11:42 +02:00
Gav Wood a306074eb7 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 1dada4f7a0 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 44eaa4a180 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
Arkadiy Paronyan 32d85fbecf Fixed consensus message garbage collection (#191)
* Fixed garbage collection logic

* Track block being imported

* mod tests
2018-05-31 18:17:18 +02:00
Gav Wood 66affa2b95 Use a simpler increment seed iterator. (#186)
* Use a simpler increment seed iterator.

* Use more secure seeding.
2018-05-30 17:40:16 +02:00
Gav Wood c831e7c511 Key generation utility (#176)
* RPCs for versioning.

* Build fix for bad merge.

* Add system_name RPC

* Fix tests.

* Fix demo build.

* Remove BadFormat.

* Add ss58check encoding and subkey.

* Improvements.

* Update Cargo.toml
2018-05-29 18:05:50 +02:00
Gav Wood 757e5beb8d 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 1204a560aa 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 58ba901ccc Preparing light client structure [v2] (#150)
* light client structure + remote call requests
2018-05-28 10:27:59 +03:00
Wei Tang 4808077674 Update transaction-pool dependency and remove ethereum-types (#174) 2018-05-26 12:14:47 +01:00
Robert Habermeier 27aafb0a04 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 24d7d38c62 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 5f9aca2137 Contracts: Memory and Module instance teardowns (#171)
* Add teardowns.

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

* Rebuild binaries.
2018-05-23 16:03:54 +01:00
Sergey Pepyakin 7312a26d09 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 d97110733d install wasm-gc using nightly (#167) 2018-05-17 14:26:11 +02:00
Robert Habermeier 491f74ad00 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
Sergey Pepyakin 37029eb42f Sandbox: run start function. (#153)
* sandbox: run start function.

* Add docs.

* Add a missing_docs to sandbox module.

* Fix typo in the naming.
2018-05-17 12:54:56 +02:00
Gav Wood 2c997769b3 Update README.md 2018-05-16 17:09:41 +02:00
Robert Habermeier a5508ccc2d 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 f997a3bdf1 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 413ebf3f19 check if block is known before re-importing (#161) 2018-05-15 10:26:55 +02:00
Arkadiy Paronyan 8bfded8d72 Networking and backend fixes (#155)
* Networking and backend fixes

* Fixed test

* Reverted DB fix

* Reverted DB fix properly

* Preserve messages with unknown parent_hash
2018-05-14 12:48:14 +02:00
Robert Habermeier 8068fdd2af 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
Arkadiy Paronyan 5ef7fc4ab5 Fixed local net CLI example (#154) 2018-05-11 14:00:29 +02:00
Robert Habermeier 35ca02970a update bootnodes (#151)
(insubstantial)
2018-05-09 18:42:49 +02:00
Robert Habermeier 266ae03666 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 6280f84716 node-key cli option (#149) 2018-05-09 12:06:59 +02:00
Robert Habermeier 7d54678331 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 a0b9c1147f update wasm 2018-05-08 17:00:32 +02:00
Robert Habermeier b10398cefa 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 5d9481140c 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 2232da2d53 don't return async::notready for messages without scheduling wakeup 2018-05-06 13:25:37 +02:00
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