git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 94e70479466583e8f96e3641f443293d8f7d77e3

moved docs

wanderer committed on 10/31/2016, 1:48:13 PM
Parent: 2541696799107df52fceda708dc8197d86ab843f

Files changed

index.jschanged
interface.jschanged
design.mddeleted
docs/design.mdadded
index.jsView
@@ -84,8 +84,13 @@
8484 await this._runningOps
8585 }
8686 }
8787
88+ _addOperation (op) {
89+ this._runningOps = Promise.all([this._runningOps, op])
90+ return this._runningOps
91+ }
92+
8893 // loads code from the merkle trie and delegates the message
8994 // Detects if code is EVM or WASM
9095 // Detects if the code injection is needed
9196 // Detects if transcompilation is needed
interface.jsView
@@ -276,9 +276,9 @@
276276 opPromise = this.environment.getBlockHash(number)
277277 }
278278
279279 // wait for all the prevouse async ops to finish before running the callback
280- this.kernel._runningOps = Promise.all([this.kernel._runningOps, opPromise])
280+ this.kernel._addOperation(opPromise)
281281 .then(values => {
282282 const hash = values.pop()
283283 this.setMemory(offset, U256_SIZE_BYTES, hash.toMemory())
284284 this.module.exports[cbOffset.toString()]()
@@ -518,10 +518,9 @@
518518 // the value was not found
519519 return null
520520 })
521521
522- // wait for all the prevouse async ops to finish before running the callback
523- this.kernel._runningOps = Promise.all([this.kernel._runningOps, opPromise])
522+ this.kernel._addOperation(opPromise)
524523 .then(values => {
525524 const oldValue = values.pop()
526525 if (valIsZero && oldValue) {
527526 // delete a value
@@ -556,11 +555,9 @@
556555 // if the value was not found return a empty array
557556 return new Uint8Array(32)
558557 })
559558
560- // wait for all the prevouse async ops to finish before running the callback
561- this.kernel._runningOps = Promise
562- .all([this.kernel._runningOps, opPromise])
559+ this.kernel._addOperation(opPromise)
563560 .then(values => {
564561 const result = values.pop()
565562 this.setMemory(resultOffset, U256_SIZE_BYTES, result)
566563 this.module.exports[cbDest.toString()]()
design.mdView
@@ -1,53 +1,0 @@
1-# Architecture
2-
3-This prototype attempts to model Ethereum as three seperate but interlocking
4-layers. Environment, Kernel, and VM.
5-```
6- +------------------+
7- | |
8- | Environment |
9- | |
10- +------------------+
11- |
12- +------------------+
13- | |
14- | Kernal |
15- | |
16- +------------------+
17- |
18- interfaces
19- |
20- +------------------+
21- | |
22- | VM |
23- | |
24- +------------------+
25-```
26-## VM
27-
28-The VM implements [webassembly](https://github.com/WebAssembly/design). Two
29-sets of intefaces are exposed to it by the kernal. The Kernal Interface and
30-The Environment Interface.
31-
32-## Kernel Interface
33-
34-The kernel handles the following
35- * Interprocess communication
36- * Intializing the VM and exposes ROM containing code to the VM (codeHandler)
37- * Exposing the namespace and Intializes the Environment which VM instance exists
38- (callHandler)
39- * Provides some built in contracts that facilitates different run levels
40- (runTx, runBlock)
41- * Provides resource sharing and limiting via gas
42-
43-The kernel Interface expose kernal primitives to VM which contain
44- * IPC (calls)
45- * Namespace Interface
46- * GET/PUT/DELETE/ROOT/NEXT - currently implemented as a `Map`
47-
48-## Environment Interface
49-
50-The Environment Interface expose the following
51-* blockchain infromation
52-* current block infromation
53-* transaction infromation
docs/design.mdView
@@ -1,0 +1,53 @@
1+# Architecture
2+
3+This prototype attempts to model Ethereum as three seperate but interlocking
4+layers. Environment, Kernel, and VM.
5+```
6+ +------------------+
7+ | |
8+ | Environment |
9+ | |
10+ +------------------+
11+ |
12+ +------------------+
13+ | |
14+ | Kernal |
15+ | |
16+ +------------------+
17+ |
18+ interfaces
19+ |
20+ +------------------+
21+ | |
22+ | VM |
23+ | |
24+ +------------------+
25+```
26+## VM
27+
28+The VM implements [webassembly](https://github.com/WebAssembly/design). Two
29+sets of intefaces are exposed to it by the kernal. The Kernal Interface and
30+The Environment Interface.
31+
32+## Kernel Interface
33+
34+The kernel handles the following
35+ * Interprocess communication
36+ * Intializing the VM and exposes ROM containing code to the VM (codeHandler)
37+ * Exposing the namespace and Intializes the Environment which VM instance exists
38+ (callHandler)
39+ * Provides some built in contracts that facilitates different run levels
40+ (runTx, runBlock)
41+ * Provides resource sharing and limiting via gas
42+
43+The kernel Interface expose kernal primitives to VM which contain
44+ * IPC (calls)
45+ * Namespace Interface
46+ * GET/PUT/DELETE/ROOT/NEXT - currently implemented as a `Map`
47+
48+## Environment Interface
49+
50+The Environment Interface expose the following
51+* blockchain infromation
52+* current block infromation
53+* transaction infromation

Built with git-ssb-web