Commit Graph
100 Commits
Author SHA1 Message Date
Robert Habermeier 4082d660ba store all future messages in BFT (#228) 2018-06-22 17:52:23 +02: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
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
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
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
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
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
Robert Habermeier 2232da2d53 don't return async::notready for messages without scheduling wakeup 2018-05-06 13:25:37 +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
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
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
Robert Habermeier 5fad9efc0a add delay test (#107) 2018-04-03 13:25:21 +02: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
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
Robert Habermeier 10546845d4 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
Robert Habermeier 1f2d01566e 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
Robert Habermeier 1d0ad42230 Verify header justification during import (#76)
* 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

* Fixed rpc tests
2018-02-16 17:28:42 +01:00
Robert Habermeier 03a51a0db8 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
Robert Habermeier ecdef68b53 fix runtime_test 2018-02-09 13:29:37 +01:00
Robert Habermeier 4ca99758df fix runtime_test 2018-02-08 23:01:26 +01:00
Robert Habermeier 6c7e286967 update wasm binaries 2018-02-08 21:07:13 +01:00
Robert Habermeier a00d0e75fd 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
Robert Habermeier 8bae8510f6 combine relay chain primitives into one module 2018-02-06 18:30:21 +01:00
Robert Habermeier 6672cf5196 merge duty roster changes 2018-02-06 17:26:52 +01:00
Robert Habermeier 10ba24673e remove debug impl in runtime-std 2018-02-06 16:44:30 +01:00
Robert Habermeier 6aaf446352 move function and proposal types to transaction module 2018-02-06 16:42:32 +01:00
Robert Habermeier 4378ce7887 fix tests and review grumbles 2018-02-06 16:35:19 +01:00
Robert Habermeier d2660900de unclobber function changes 2018-02-06 15:41:28 +01:00
Robert Habermeier de65de4758 fix tests after merge 2018-02-06 14:44:25 +01:00
Robert Habermeier 2b691cef06 initial merge 2018-02-06 14:12:54 +01:00
Robert Habermeier 4cba452c31 fix tests 2018-02-06 13:39:29 +01:00
Robert Habermeier aa7432f15e get compiling on wasm 2018-02-06 13:27:09 +01:00
Robert Habermeier d43c93a7dc update native executor tests to use new tx format 2018-02-06 12:44:08 +01:00
Robert Habermeier af2fdc5478 fix compilation for native 2018-02-06 12:26:04 +01:00
Robert Habermeier 5a675e9c64 fix most issues with compiling on WASM 2018-02-06 12:02:03 +01:00
Robert Habermeier b58df7892f integrate new primitives with native-runtime 2018-02-05 17:40:49 +01:00
Robert Habermeier 2bc7c57359 reintroduce slicable to primitives 2018-02-05 16:15:45 +01:00
Robert Habermeier e4e755a87a refactor codec 2018-02-01 13:29:16 +01:00
Robert Habermeier 188332cc4b extract out all primitives 2018-02-01 11:13:55 +01:00
Robert Habermeier a3b9c2af7d fix compiler warning 2018-01-31 22:28:11 +01:00
Robert Habermeier 0035369f82 allow polkadot-primitives to compile on nightly 2018-01-31 22:27:07 +01:00
Robert Habermeier 29c3a585a1 Merge branch 'master' into author-relay-block 2018-01-31 18:11:30 +01:00
Robert Habermeier 4b2bd5ec72 fully refactor runtime-std to use conditional compilation 2018-01-30 23:47:29 +01:00
Robert Habermeier 2c39e247d6 clean up workspaces a little 2018-01-30 19:35:09 +01:00
Robert Habermeier 8e6cb1b6e2 more idiomatic std features 2018-01-30 19:28:57 +01:00
Robert Habermeier a68b187f4d extract out runtime-codec to a separate crate 2018-01-30 18:51:12 +01:00
Robert Habermeier e014c8a553 make more readable 2018-01-23 19:50:56 +01:00
Robert Habermeier 9b930a18a5 using non-static traits for environmental 2018-01-23 19:45:36 +01:00
Robert Habermeier 21a4f9f821 fix grumbles 2018-01-23 17:43:35 +01:00
Robert Habermeier c27ea0b73b Merge branch 'master' into runtime-tweaks 2018-01-23 17:22:04 +01:00
Robert Habermeier 954a4dc8ef clean up some unsafety in Slicable 2018-01-23 17:21:20 +01:00
Robert Habermeier b9cc928495 update the WASM runtime imports 2018-01-23 17:05:35 +01:00
Robert Habermeier ce5f4da907 reorganize native-support exports 2018-01-23 16:51:04 +01:00
Robert Habermeier 9c9a197f3a Merge branch 'polkadot-runtime-skeleton' into environmental-api 2018-01-17 19:30:46 +01:00
Robert Habermeier 3ed6784911 use new environmental API 2018-01-17 19:27:38 +01:00
Robert Habermeier 21ab1935e7 fix unsafety hole around unwinding 2018-01-17 19:20:38 +01:00
Robert Habermeier 3c67ac115b fix unsafety hole in environmental using function 2018-01-17 18:12:50 +01:00
Robert Habermeier 5137d1a1d0 validator -> authority 2018-01-16 20:04:32 +01:00
Robert Habermeier 02bdf0ee29 test consensus completion 2018-01-16 20:01:17 +01:00
Robert Habermeier 76fafcb39f initial test harness 2018-01-16 17:47:09 +01:00
Robert Habermeier f87893cd87 test context for full agreement protocol 2018-01-14 23:44:19 +01:00
Robert Habermeier 5a369064a4 import a local candidate when it is available 2018-01-13 19:19:41 +01:00
Robert Habermeier 379bcb46c0 add test for batch filling 2018-01-12 16:22:09 +01:00
Robert Habermeier 0e8458491f fill batch statements from table 2018-01-12 14:50:28 +01:00
Robert Habermeier 89d344fb3f update parking_lot 2018-01-10 22:03:34 +01:00
Robert Habermeier 649fbf2938 Merge branch 'master' into rh-candidate-agreement-glue 2018-01-10 22:02:57 +01:00
Robert Habermeier 00c4ee2d81 create the overarching agreement and IO futures 2018-01-10 21:58:56 +01:00
Robert Habermeier 3d9cc2697c incoming message handler 2018-01-10 21:20:53 +01:00
Robert Habermeier 7b67bc63da round-robin message handler 2018-01-09 21:03:06 +01:00
Robert Habermeier 2fbc256b66 instantiate the agreement future 2018-01-08 16:36:35 +01:00
Robert Habermeier 9ff2fa550f beginnings of shared table 2018-01-08 15:34:21 +01:00
Robert Habermeier acca871d20 define context trait and initialize statement table 2018-01-03 17:06:04 +01:00
Robert Habermeier 45c3e40a62 Candidate Agreement + Consensus (#29)
* candidate statement importing

* import votes on validity

* import availability votes

* candidate receipt type

* make table mod public

* test context for table

* add harness for tests

* some tests for misbehavior

* produce proposal from table

* count candidate issuance as implicit vote

* keep track of messages known by validators

* fix primitives compilation

* simple BFT agreement

* kill unused macro_use annotation

* tests for BFT agreement

* test for not concluding on different prepares

* return summary upon statement import

* accept bft agreement on proposal not locally submitted

* check justification set for BFT

* BFT rewrite: vote accumulator with tests

* squash some warnings

* a few more tests for the accumulator

* add sender to table's signed statement

* implement honest node strategy for BFT

* inex -> index

* import and broadcast lock proofs

* poll repeatedly when state changes

* don't broadcast advance vote immediately if locked

* do not check validity of locked candidate

* basic tests for the strategy

* remove unused context trait and fix warning

* address some review grumbles

* address some more review nits

* fix lock import logic and add a test

* fix spaces

* fix a couple more style grumbles

* more type-safe justifications

* rename Communication enum variants

* improve some panic guard proofs

* add trailing comma
2018-01-03 15:50:05 +01:00
Robert Habermeier f2cbae5948 add trailing comma 2018-01-01 20:36:54 +01:00
Robert Habermeier 53bc9e85bc improve some panic guard proofs 2018-01-01 20:25:22 +01:00
Robert Habermeier 8310cae9f0 rename Communication enum variants 2018-01-01 20:06:03 +01:00
Robert Habermeier cd438e51a8 more type-safe justifications 2018-01-01 20:00:44 +01:00
Robert Habermeier e0b7e77f2c fix a couple more style grumbles 2017-12-31 20:10:37 +01:00
Robert Habermeier b44e8fd781 fix spaces 2017-12-29 15:41:39 +01:00
Robert Habermeier a03d16c862 fix lock import logic and add a test 2017-12-29 15:15:10 +01:00
Robert Habermeier 6ab0fcef97 address some more review nits 2017-12-29 14:40:47 +01:00
Robert Habermeier 43b68b52bf address some review grumbles 2017-12-29 14:28:13 +01:00
Robert Habermeier 136645aa4c remove unused context trait and fix warning 2017-12-29 02:56:04 +01:00
Robert Habermeier 4b3b1249dc basic tests for the strategy 2017-12-27 21:35:19 +01:00
Robert Habermeier 1503a23c43 do not check validity of locked candidate 2017-12-27 19:14:55 +01:00
Robert Habermeier eec6d47a80 don't broadcast advance vote immediately if locked 2017-12-27 18:48:35 +01:00
Robert Habermeier 80e23bbfb4 poll repeatedly when state changes 2017-12-27 18:35:21 +01:00
Robert Habermeier a16c06da5b import and broadcast lock proofs 2017-12-27 18:27:18 +01:00
Robert Habermeier cb7d407880 inex -> index 2017-12-27 18:03:41 +01:00