Commit Graph

8072 Commits

Author SHA1 Message Date
Gav b104f5e6e4 Compile polkadot-runtime both for Wasm ad native, allowing for testing and direct usage. 2018-01-09 13:47:28 +01:00
Gav 5ab59bb171 Make initial runtime skeleton compile. 2018-01-08 19:32:46 +01:00
Gav a9fe12eb69 Clean up the runtime skeleton. 2018-01-08 17:56:16 +01:00
Gav 1f183d688a Introduce basic skeleton for Polkador runtime. 2018-01-08 17:13:44 +01:00
Gav Wood a670208a33 Introduce first groundwork for Wasm executor (#27)
* Introduce first groundwork for Wasm executor.

* Remove old Rust-runtime code.

* Avoid commiting compled files.

* Add runtime precompile.

* Rename so module makes more sense.

* Further renaming.

* Ensure tests work.

* Allow bringing in of externalities.

- Add util functions/macros.
- Add uncompacted runtime.
- Add some external crates from pwasm-std for managing allocs/memory
stuff.

* Nice macros for imports.

* Allow passing in of data through allocators.

Make memcpy and malloc work.
Basic allocator.

* Can now pass in bytes to WasmExecutor.

* Additional cleanup.

* Switch usages of `OutData` to `u64`

No need to be able to return bytes anymore.

* convert to safe but extremely verbose type conversion.

@rphmeier any more concise way of doing this?

* Remove StaticExternalities distinction.

* Remove another unused use.

* Refactor wasm utils out

* Remove extraneous copies that weren't really testing anything.

* Try to use wasm 0.15

* Make it work!

* Call-time externalities working.

* Add basic externalities.

* Fix grumbles and note unwraps to be sorted.

* Test storage externality.

Unforunately had to change signatures of externalities to avoid
immutable function returning a reference. Not sure what to do about
this...

* Fix nits.

* Compile collation logic.

* Move back to refs. Yey.

* Remove "object" id for storage access.

* Fix test.

* Fix up rest of tests.

* remove unwrap.

* Expose set/get code in externalities

Also improve tests and add nice wrappers in rust-wasm.

* Add validator set.

* Introduce validator set into externalities and test.

* Add another external function.

* Remove code and validators; use storage for everything.

* Introduce validators function.

* Tests (and a fix) for the validators getter.

* Allow calls into runtime to return data.

* Remove unneeded trace.

* Make runtime printing a bit nicer.

* Create separate runtimes for testing and polkadot.

* Remove commented code.

* Use new path.

* Refactor into shared support module.

* Fix warning.

* Remove unwraps.

* Make macro a little less unhygenic.

* Add wasm files.
2018-01-08 16:48:45 +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
Robert Habermeier 2540a8728d implement honest node strategy for BFT 2017-12-27 17:46:41 +01:00
Robert Habermeier d5684c96c9 add sender to table's signed statement 2017-12-22 17:42:10 +01:00
Robert Habermeier 4a2162868b a few more tests for the accumulator 2017-12-22 17:11:21 +01:00
Robert Habermeier b89007122d squash some warnings 2017-12-21 22:54:51 +01:00
Robert Habermeier 38b4dc2f22 BFT rewrite: vote accumulator with tests 2017-12-21 22:53:17 +01:00
Robert Habermeier 8e075e9963 check justification set for BFT 2017-12-18 16:07:55 +01:00
Robert Habermeier dcce39c441 accept bft agreement on proposal not locally submitted 2017-12-18 15:49:35 +01:00
Robert Habermeier dd7061e0d7 return summary upon statement import 2017-12-18 14:17:22 +01:00
Robert Habermeier 534b046040 test for not concluding on different prepares 2017-12-18 12:45:30 +01:00
Robert Habermeier 224efd656b tests for BFT agreement 2017-12-18 11:47:56 +01:00
Robert Habermeier 6da40e8a7a kill unused macro_use annotation 2017-12-18 11:08:43 +01:00
Robert Habermeier 9a030d6e09 simple BFT agreement 2017-12-18 11:08:29 +01:00
Robert Habermeier afdc9d69e2 fix primitives compilation 2017-12-14 11:56:14 +01:00
Robert Habermeier 8d433278de Merge branch 'master' into rh-candidate-agreement 2017-12-14 11:54:25 +01:00
Robert Habermeier 233d88fdb8 keep track of messages known by validators 2017-12-13 18:45:08 +01:00
Robert Habermeier 655b8ce275 count candidate issuance as implicit vote 2017-12-13 16:41:58 +01:00
Robert Habermeier 9612e1d7c1 Minimal collation work-flow and necessary traits (#25)
* collator crate skeleton and description

* parachain primitives: proof -> witness and egress format

* collation of ingress queues through trait

* add ingress collation test

* structure for collated ingress

* add collated ingress to proposal

* witness -> proof

* ingress collation and candidate creation + code cleanup

* update collator lib to new definitions

* address formatting grumble
2017-12-13 15:04:58 +01:00
Robert Habermeier 57f6dd4cc5 produce proposal from table 2017-12-13 12:12:26 +01:00
Robert Habermeier ee05b9dbdf some tests for misbehavior 2017-12-13 10:39:33 +01:00
Robert Habermeier f8a28e4de4 add harness for tests 2017-12-13 10:11:41 +01:00
Robert Habermeier 45ac233cd1 test context for table 2017-12-12 18:27:24 +01:00
Robert Habermeier 2fa8fad0ef make table mod public 2017-12-12 18:13:08 +01:00
Robert Habermeier 47d93e2cbd candidate receipt type 2017-12-12 18:09:07 +01:00
Robert Habermeier 10312920b5 import availability votes 2017-12-12 17:57:03 +01:00
Robert Habermeier cf4e4d7001 import votes on validity 2017-12-12 17:48:13 +01:00