Commit 94e70479466583e8f96e3641f443293d8f7d77e3
moved docs
wanderer committed on 10/31/2016, 1:48:13 PMParent: 2541696799107df52fceda708dc8197d86ab843f
Files changed
index.js | changed |
interface.js | changed |
design.md | deleted |
docs/design.md | added |
index.js | ||
---|---|---|
@@ -84,8 +84,13 @@ | ||
84 | 84 | await this._runningOps |
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | + _addOperation (op) { | |
89 | + this._runningOps = Promise.all([this._runningOps, op]) | |
90 | + return this._runningOps | |
91 | + } | |
92 | + | |
88 | 93 | // loads code from the merkle trie and delegates the message |
89 | 94 | // Detects if code is EVM or WASM |
90 | 95 | // Detects if the code injection is needed |
91 | 96 | // Detects if transcompilation is needed |
interface.js | ||
---|---|---|
@@ -276,9 +276,9 @@ | ||
276 | 276 | opPromise = this.environment.getBlockHash(number) |
277 | 277 | } |
278 | 278 | |
279 | 279 | // 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) | |
281 | 281 | .then(values => { |
282 | 282 | const hash = values.pop() |
283 | 283 | this.setMemory(offset, U256_SIZE_BYTES, hash.toMemory()) |
284 | 284 | this.module.exports[cbOffset.toString()]() |
@@ -518,10 +518,9 @@ | ||
518 | 518 | // the value was not found |
519 | 519 | return null |
520 | 520 | }) |
521 | 521 | |
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) | |
524 | 523 | .then(values => { |
525 | 524 | const oldValue = values.pop() |
526 | 525 | if (valIsZero && oldValue) { |
527 | 526 | // delete a value |
@@ -556,11 +555,9 @@ | ||
556 | 555 | // if the value was not found return a empty array |
557 | 556 | return new Uint8Array(32) |
558 | 557 | }) |
559 | 558 | |
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) | |
563 | 560 | .then(values => { |
564 | 561 | const result = values.pop() |
565 | 562 | this.setMemory(resultOffset, U256_SIZE_BYTES, result) |
566 | 563 | this.module.exports[cbDest.toString()]() |
design.md | ||
---|---|---|
@@ -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.md | ||
---|---|---|
@@ -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