Commit Graph

1869 Commits

Author SHA1 Message Date
Robert Habermeier fdc991f973 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 bda343ce67 Merge branch 'master' into gav-demo 2018-03-02 14:59:32 +01:00
Robert Habermeier b772188145 Integrate transaction pool to the proposal logic (#80)
* reshuffle consensus libraries

* polkadot-useful type definitions for statement table

* begin BftService

* primary selection logic

* bft service implementation without I/O

* extract out `BlockImport` trait

* allow bft primitives to compile on wasm

* Block builder (substrate)

* take polkadot-consensus down to the core.

* test for preemption

* fix test build

* Fix wasm build

* Bulid on any block

* Test for block builder.

* Block import tests for client.

* Tidy ups

* clean up block builder instantiation

* justification verification logic

* JustifiedHeader and import

* Propert block generation for tests

* network and tablerouter trait

* use statement import to drive creation of further statements

* Fixed rpc tests

* custom error type for consensus

* create proposer

* asynchronous proposal evaluation

* inherent transactions in polkadot runtime

* fix tests to match real polkadot block constraints

* implicitly generate inherent functions

* add inherent transaction functionality to block body

* block builder logic for polkadot

* some tests for the polkadot API

* avoid redundancy in native code compatibility check

* helper for extracting nonce

* transaction pool implementation

* transaction pool

* integrate transaction pool with proposer

* indentation

* kill storage keys module

* accept new transactions to replace old
2018-03-02 09:38:58 +01:00
Gav 56a2623c5a Initial draft of stakeholder democracy. 2018-02-25 18:37:07 +01:00
Gav f807fc6799 Use BTreeMap rather than HashMap in demo runtime. 2018-02-25 16:58:07 +01:00
Robert Habermeier 1e6cad908e Proposal creation and evaluation to plug into BFT (#77)
* reshuffle consensus libraries

* polkadot-useful type definitions for statement table

* begin BftService

* primary selection logic

* bft service implementation without I/O

* extract out `BlockImport` trait

* allow bft primitives to compile on wasm

* Block builder (substrate)

* take polkadot-consensus down to the core.

* test for preemption

* fix test build

* Fix wasm build

* Bulid on any block

* Test for block builder.

* Block import tests for client.

* Tidy ups

* clean up block builder instantiation

* justification verification logic

* JustifiedHeader and import

* Propert block generation for tests

* network and tablerouter trait

* use statement import to drive creation of further statements

* Fixed rpc tests

* custom error type for consensus

* create proposer

* asynchronous proposal evaluation

* inherent transactions in polkadot runtime

* fix tests to match real polkadot block constraints

* implicitly generate inherent functions

* add inherent transaction functionality to block body

* block builder logic for polkadot

* some tests for the polkadot API
2018-02-25 10:58:17 +01:00
Gav 82efaf35b2 Fix up wasm build. 2018-02-20 12:20:15 +01:00
Gav Wood 5f9be58d04 Optional storage entries (#75)
* Block builder (substrate)

* Fix wasm build

* Bulid on any block

* Test for block builder.

* Block import tests for client.

* Tidy ups

* Repotted client

* Avoid pointless work

* All backend stuff now manages optional storage.

Also simplified a lot of the backend.

* Native runtime-io now supports empty storage items.

* Finish up the API transition.

* Build fix.

* Fix tests.

* Remerge in changes to client.

* Final fixes.

* Unrevert typos

* Remove accidentally committed change

* Bring back zero copy

* Fix merge.
2018-02-19 20:05:30 +01:00
Gav Wood d49eeffce4 Block builder (substrate) (#73)
* Block builder (substrate)

* Fix wasm build

* Bulid on any block

* Test for block builder.

* Block import tests for client.

* Tidy ups

* clean up block builder instantiation

* Propert block generation for tests

* Fixed rpc tests
2018-02-15 16:38:19 +01:00
Robert Habermeier 6fbe366f23 Split BFT into substrate-bft and runtime-specific proposer logic (#72)
* reshuffle consensus libraries

* polkadot-useful type definitions for statement table

* begin BftService

* primary selection logic

* bft service implementation without I/O

* extract out `BlockImport` trait

* allow bft primitives to compile on wasm

* take polkadot-consensus down to the core.

* test for preemption

* fix test build
2018-02-15 14:20:18 +01:00
Gav Wood bffdc5811c Additional runtime tests for the test-runtime (#69)
* Remove rustc dependency from ed25519 and refactor a little.

* Runtime support provides more extensive test-key functionality.

* Additional APIs for ed25519 stuff.

* Extensive test for test-runtime.

* Fixes for the new test key API.

* Additional convenience for tests

* Take advantage of more convenient API.

* Redo formating.

* Remove old test identities.

* Remove boilerplate, add test.

* Refactor out unneeded code.

* Clean up algo for determining authorities.

* Remove unneeded API.

* Make `to_*` consume

* Only export keyring when testing

* Fix build & warning

* Extract Keyring into separate library.

* Add tests for Keyring and a trait-based API.

* Address grumbles.
2018-02-12 15:30:38 +01:00
Gav 99ff2faeb8 Merge branch 'update-wasm' of github.com:paritytech/polkadot into update-wasm 2018-02-09 14:19:13 +01:00
Gav c05e9e59f1 Update builds and fix up test-runtime. 2018-02-09 14:17:19 +01:00
Gav Wood ece0172e31 Introduce toy runtime for testing inside substrate. (#66)
* Introduce simple blockchain runtime for substrate tests.

* Remove bad files.

* Add needed wasm binaries.

* Refactoring.

- Repot files in test-runtime.
- Rename troublesome `Joiner::join` to `Joiner::and`.
- Rework `Slicable` to dedup code.

* More fixes and refactoring

* Rebuild substrate test wasm.

* Fix merge errors.

* Rename the disasterously named `to_vec` to `encode`.

Also rename `as_slice_then` to `with_encoded`.

* Tests for toy runtime.

* Fix doc nit
2018-02-09 13:24:30 +01:00
Robert Habermeier 56fd052a26 fix runtime_test 2018-02-08 23:01:26 +01:00
Robert Habermeier 33fff3965f update wasm binaries 2018-02-08 21:07:13 +01:00
Robert Habermeier 7c62519781 Re-introduce zero copy codec and add minimal polkadot client API which uses linked native runtime (#65)
* client-api type and move duty roster types to primitives

* tuple implementation for slicable

* mild cleanup of deserialization code

* stubs which handle encoding and decoding themselves

* fancier impl_stubs macro

* zero-copy slicable API

* minimal polkadot-client API

* fix WASM API generation

* move native environment stuff to substrate executor

* fix warnings and grumbles
2018-02-08 19:20:34 +01:00
Gav 1a8fe81cfe Fix runtime paths. 2018-02-08 14:52:35 +01:00
Gav aa67fe3781 Fix warning and directory restructure. 2018-02-08 14:29:30 +01:00