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

Initialization and initial state #39

Closed
mrsmkl opened this issue Oct 5, 2017 · 3 comments
Closed

Initialization and initial state #39

mrsmkl opened this issue Oct 5, 2017 · 3 comments

Comments

@mrsmkl
Copy link
Member

mrsmkl commented Oct 5, 2017

Currently the specification of the task is the hash of the initial state. Because of this, when a task is posted as wasm file, it has to be associated with an initial state hash. Then the solvers and verifiers can check if the wasm file and the initial state match.
There is a problem if the wasm file and the initial state do not match. The whole initial state could be posted instead, but it might be several times larger than the wasm file (if decoding the instructions is not implemented in solidity).
Solution alternatives:

  1. Implement preprocessing in solidity
  2. Implement preprocessor as wasm module

The second alternative is easier, for example the ocaml runtime can be compiled into wasm: https://github.com/sebmarkbage/ocamlrun-wasm

@terminaldweller
Copy link
Collaborator

i think it would be a good idea to do options number one even though its gonna take more time to do it.

@mrsmkl
Copy link
Member Author

mrsmkl commented Oct 6, 2017

Ok. I think most of the work would be handling the wasm binary format. One feature that we will need to to have several different types of task, basically they would specify which judge contract to use (for example scrypt-interactive and the solidity pre-processor would be custom judges).

To build the judges, it will be useful to have a kind of library that will make memory handling easier. For example in https://github.com/TrueBitFoundation/webasm-solidity/blob/master/onchain.sol there is too much copypasta, need to find out a way to make it cleaner.

@mrsmkl
Copy link
Member Author

mrsmkl commented Nov 15, 2017

Working on this issue with this repo: https://github.com/TrueBitFoundation/wasm-preprocessing, closing it here.

@mrsmkl mrsmkl closed this as completed Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants