Commit Graph

29 Commits

Author SHA1 Message Date
Gav c8c0879f3d Correct implementation of memcmp 2018-01-29 17:19:56 +01:00
Gav 769bd9d101 Avoid using the controversial Vec::from_raw_parts. 2018-01-28 20:39:18 +01:00
Gav 6451b612cc Less constant-bloat. 2018-01-28 20:30:44 +01:00
Gav bc6eb7d70a Refactor executor. 2018-01-28 13:48:24 +01:00
Gav daa77d09a6 Rearrange export structure to something a bit more convenient. 2018-01-28 13:41:22 +01:00
Gav d97520c7f0 Introduce hex/string printing in runtime. 2018-01-27 13:42:40 +01:00
Gav ace1387076 Fix everything. 2018-01-27 13:32:30 +01:00
Gav 0b138b0fd5 Introduce tests which demonstrate bad wasm compiler. 2018-01-26 19:26:10 +01:00
Gav bbac6f8da1 Handle panics in native execution. 2018-01-26 15:24:12 +01:00
Gav ead42293bc Tests for native/wasm runtime 2018-01-25 19:28:28 +01:00
Gav 1617900c1d Implement NativeExecutor, which attempts a native execution and falls back on Wasm otherwise. 2018-01-23 20:38:01 +01:00
Gav 8ca5c09961 Initial (non-functional) code.
- Kill Externalities Error type requirement.
2018-01-23 17:27:43 +01:00
Gav 2789bc2b8f Simple governance subsytem. 2018-01-21 22:35:25 +01:00
Gav ecb504e467 Build fix for wasm. 2018-01-19 20:31:18 +01:00
Gav c29313c618 Introduce better hashing.
- Blake2 for secure hashing
- XX for fast hashing
2018-01-19 14:17:56 +01:00
Gav 07c14104f7 Tests for ed25519 verify. 2018-01-18 12:31:34 +01:00
Gav 6b1153d975 Add ed25519_verify external. 2018-01-17 19:05:31 +01:00
Gav 98faf54ec4 Repot and introduce keccak-256 external. 2018-01-17 11:45:36 +01:00
Gav 17c8bad87c Clean up (Test)Externalities. 2018-01-16 19:07:10 +01:00
Gav 74d5be0e80 use externalities for chain_id 2018-01-16 19:04:13 +01:00
Gav dc6ebf71cf Fix up wasm runtime. 2018-01-16 18:56:57 +01:00
Gav ad9037df2d Add native environment to make native source-code compatible with wasm.
Also tests.
2018-01-10 14:39:56 +01:00
Gav 391fb19143 Fix test. 2018-01-09 17:50:35 +01:00
Gav 55418c7ed8 Fix path. 2018-01-09 15:59:05 +01:00
Gav 06791fa07f Update path. 2018-01-09 15:58:45 +01:00
Gav f3dd41efd6 Fix warning. 2018-01-09 15:50:48 +01:00
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 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