Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation #151

Merged
merged 117 commits into from
Jun 7, 2019
Merged

Validation #151

merged 117 commits into from
Jun 7, 2019

Conversation

JakeOShannessy
Copy link
Contributor

This PR implements the validation code and links it to the kernel as per #141. Currently the validation is functioning, including recognising system calls (although the whitelist needs to be updated).

It also includes cap9-build as per #150. This forms part of the workflow for building conformant cap9 procedures.

More details to come.

The previous nightly version specified (nightly-2019-03-05) had an issue
where components where not supported on Windows. 2018 versions had an
issue with some wasm memory functions not being finalised
(see rust-lang/rust#56292). This could all be
wrong but I found this version worked for me where others didn't.
This tests the proofs-of-concept for the validation code. It is not
currently integrated into the test suites or CI.
This is what I'd used previously and it had always worked well for me.
@Latrasis
Copy link
Member

Latrasis commented Jun 5, 2019

@JakeOShannessy: I'm seeing parity-wasm being locally imported outside the repo, is this the same parity-wasm package or is it modified?

I'm experimenting to try and get around #155, I thought I had a solution but perhaps not. It was modified for testing, but I still haven't found a complete solution yet.

Ok, I'm not sure if I can help in that front, but i'll see if it's feasible to statically link the cap9_syscall_low using external link attributes.

@JakeOShannessy
Copy link
Contributor Author

Ok, that would be nice to be able to do.

@Latrasis Latrasis mentioned this pull request Jun 5, 2019
* wasm-parser: remove parity-wasm dependency

* wasm-parser: proof of basic idea

* wasm-parser: import instruction mappings from parity-wasm

* wasm-parser: build and link with kernel

* wasm-parser: fix parsing of import entries

* wasm-parser: add missing file

* kernel: add test script

* wasm-parser: minor cleanup

* circleci: don't force rebuild of parity-ethereum

* kernel: update tests to be more accurate

* kernel: update nightly version for alloc crate

* circleci: fix error with parity installation

* circleci: fix error in previous commit

* wasm-parser: reinclude alloc

* wasm-parser: merge Cursor and CodeCursor

* circleci: add example contract 2

* circleci: set-up environment for test

* circleci: fix example_contract_2 build

* wasm-parser: properly validate instructions in syscall

* wasm-parser: fix import cursor progression

* circleci: remove config step from parity

* circleci: clear cache
@JakeOShannessy
Copy link
Contributor Author

This now uses a smaller parser, which cannabilises parts of parity-wasm for parsing instructions. It's functioning with all the capabilities it needs to perform verification and is successfully integrated into the kernel with tests to prove it.

It is not yet tested to demonstrate whether its determination of contract validity are correct, there are still a few items that need to be fixed.

@Latrasis
Copy link
Member

Latrasis commented Jun 7, 2019

@JakeOShannessy: Let me know when ready for review

@JakeOShannessy JakeOShannessy marked this pull request as ready for review June 7, 2019 04:54
@JakeOShannessy
Copy link
Contributor Author

I better merge in master first.

Note: I've removed unimplemented!() from the constructor as it will
wipe out all my tests.
@JakeOShannessy
Copy link
Contributor Author

Master merged in. I made two changes to the proc table stuff in master:

  1. Removed the uimplemented!() call in the constructor. If that's present we can't test the validation stuff.
  2. Skipped the entry procedure test in index.js as the underlying code hasn't been implemented yet,

@JakeOShannessy
Copy link
Contributor Author

Let's get this merged in so that we can start coordinating stuff.

@JakeOShannessy JakeOShannessy mentioned this pull request Jun 7, 2019
7 tasks
@Latrasis Latrasis merged commit 947de0f into master Jun 7, 2019
@JakeOShannessy JakeOShannessy deleted the validation branch June 11, 2019 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-ewasm Target system: Ethereum Wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants