Skip to content

Commit

Permalink
Update vm_abi.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aboodman authored Jun 18, 2018
1 parent 627477e commit 7b81d94
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drafts/vm_abi.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ boundaries.

Conceptually, actors are isolated programs, without access to the outside world. This isolation isn't currently enforced, but will be in a subsequent version of the protocol. Therefore, actors SHOULD access the outside world only via explicit _syscalls_ provided by Filecoin.

Because it is thought that actors will eventually run inside the eWASM VM, Filecoin follows the WASM system of organizing syscalls using a two-level namespace composed of a _module name_ and an _import name_.
Because it is thought that actors will eventually run inside the [eWASM VM](https://github.com/ewasm), Filecoin follows the WASM system of organizing syscalls using a [two-level namespace](https://github.com/WebAssembly/design/blob/master/Modules.md#imports) composed of a _module name_ and an _import name_.

The currently available modules are:

Expand All @@ -84,7 +84,7 @@ Writes a new chunk to storage if the chunk is not already present.
_codec_ is the multicodec to use to interpret the data. See:
https://github.com/multiformats/multicodec/blob/master/table.csv

`storagePut` will fail and return an empty cid if:
`put` will fail and return an empty cid if:
* data cannot be decoded with codec
* data is incomplete: refers to other chunks which do not exist in storage

Expand All @@ -98,17 +98,17 @@ If the chunk does not exist, the returned bytes array is empty.

Executes an atomic compare-and-swap of the old and new head CIDs provided.

If the current head for this actor equals old cid, `storageCommit`
If the current head for this actor equals old cid, `commit`
atomically replaces it with the new cid and returns `0`. The new head,
along with all chunks that head refers to become instantaneous visible to
all actors.

If the current head for this actor does not equal the old `cid`,
`storageCommit` exits and returns `1` without changing anything.
`commit` exits and returns `1` without changing anything.

### `head() cid`

Returns the last cid successfully written by `storageCommit`.
Returns the last cid successfully written by `commit`.

# TODO

Expand Down

0 comments on commit 7b81d94

Please sign in to comment.