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

[engine] new JS VM #81

Open
2 of 3 tasks
florianlenz opened this issue Aug 15, 2018 · 4 comments
Open
2 of 3 tasks

[engine] new JS VM #81

florianlenz opened this issue Aug 15, 2018 · 4 comments
Assignees
Milestone

Comments

@florianlenz
Copy link
Contributor

florianlenz commented Aug 15, 2018

Feature / Issue

Otto doesn't really work out for us since it doesn't offer the performance we need nor the sandboxing features (like limiting the allocated memory). We should switch to duktape (there are go bindings).

things to figure out:

  • we need duk_create_heap for sandboxing to make sure there is no way to allocate more mem than we provide. However it doesn't seem to be implemented (https://github.com/olebedev/go-duktape/blob/v3/api.go#L1597). However, it's used here but it's not exported so we might need to fork.
  • take in account this file. We need to understand it in order to build a secure VM.

Acceptance criteria

  • tests
  • all current feature of the DApp engine must work
  • sandboxing
@florianlenz florianlenz added this to the 1.2.0 milestone Aug 19, 2018
@borjantrajanoski borjantrajanoski self-assigned this Aug 20, 2018
@borjantrajanoski
Copy link
Contributor

Some sample code on how a call back can be done with duktape

Is there any reason why a map cannot be used in this way?

Callback proof of concept rc1

@florianlenz
Copy link
Contributor Author

Good question, I didn't look too much into how function should work, but there should be a call method or something like this on a value (you might need to transform it to a function - there should be a toFunction method)

Maps are not supported afaik. But we can go without them :) For e.g. the database we can just export dbPut instead of the object .

@borjantrajanoski
Copy link
Contributor

@kevowevo this will be done at the 28th

@borjantrajanoski
Copy link
Contributor

Finished initial migration from Otto to Duktape PR 94

Needs careful review and potential small fixes to make sure integration is fully compatible

@florianlenz florianlenz modified the milestones: 1.2.0, 1.3.0 Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants