From f01f3e1140e711a7ecf4b5c830a3cd379024916e Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 20:54:04 +0100 Subject: [PATCH 01/13] EEI: getBlockDifficulty is writing into memory --- eth_interface.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index f3c8c0a0..a0e4f8d4 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -273,11 +273,11 @@ Get the block’s difficulty. **Parameters** -*none* +- `offset` **i32** the memory offset to load the difficulty into **Returns** -`difficulty` **integer** +*nothing* ## externalCodeCopy From d3e2c6266de458696c43f0a644a6c3e2e07e34eb Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 20:56:34 +0100 Subject: [PATCH 02/13] EEI: update parameters for log --- eth_interface.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index a0e4f8d4..7fd57166 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -350,11 +350,11 @@ Creates a new log in the current environment - `dataOffset` **i32** the memory offset to load data from - `length` **i32** the data length -- `topic1` **integer** -- `topic2` **integer** -- `topic3` **integer** -- `topic4` **integer** -- `topic5` **integer** +- `numberOfTopics` **i32** the number of topics following (0 to 4) +- `topic1` **i32** the memory offset to load topic1 from +- `topic2` **i32** the memory offset to load topic2 from +- `topic3` **i32** the memory offset to load topic3 from +- `topic4` **i32** the memory offset to load topic4 from **Returns** From 789215f86468b65c0b5b75dcac0bebed10f89d47 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 20:58:25 +0100 Subject: [PATCH 03/13] EEI: gas limits are i64 types --- eth_interface.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index 7fd57166..73fca204 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -37,7 +37,7 @@ Subtracts an amount to the gas counter **Parameters** -- `amount` **integer** the amount to subtract to the gas counter +- `amount` **i64** the amount to subtract to the gas counter **Returns** @@ -89,7 +89,7 @@ Sends a message with arbitrary date to a given address path **Parameters** -- `gas` **integer** the gas limit +- `gas` **i64** the gas limit - `addressOffset` **i32** the memory offset to load the address from - `valueOffset` **i32** the memory offset to load the value from - `dataOffset` **i32** the memory offset to load data from @@ -135,7 +135,7 @@ data passed with the message call instruction or transaction. **Parameters** -- `gas` **integer** the gas limit +- `gas` **i64** the gas limit - `addressOffset` **i32** the memory offset to load the address from - `valueOffset` **i32** the memory offset to load the value from - `dataOffset` **i32** the memory offset to load data from @@ -154,7 +154,7 @@ persisting the current values for sender and value. **Parameters** -- `gas` **integer** the gas limit +- `gas` **i64** the gas limit - `addressOffset` **i32** the memory offset to load the address from - `dataOffset` **i32** the memory offset to load data from - `dataLength` **i32** the length of data @@ -316,7 +316,7 @@ Returns the current gasCounter **Returns** -`gasLeft` **integer** +`gasLeft` **i64** ## getBlockGasLimit @@ -328,7 +328,7 @@ Get the block’s gas limit. **Returns** -`blockGasLimit` **integer** +`blockGasLimit` **i64** ## getTxGasPrice From 9206d627b98ccdcd13f31a38e6fc923c045810d7 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 21:00:10 +0100 Subject: [PATCH 04/13] EEI: getTxGasPrice is a value type now and hence writes to memory --- eth_interface.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index 73fca204..a8d092d1 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -336,11 +336,11 @@ Gets price of gas in current environment. **Parameters** -*none* +- `valueOffset` **i32** the memory offset to write the value to **Returns** -`gasPrice` **integer** +*nothing* ## log From bc23399f33656e3d191aea488271a3742415b861 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 21:00:42 +0100 Subject: [PATCH 05/13] EEI: block number is i64 --- eth_interface.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index a8d092d1..619d81e8 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -76,7 +76,7 @@ Gets the hash of one of the 256 most recent complete blocks. **Parameters** -- `number` **integer** which block to load +- `number` **i64** which block to load - `resultOffset` **i32** the memory offset to load the hash into **Returns** @@ -370,7 +370,7 @@ Get the block’s number. **Returns** -`blockNumber` **integer** +`blockNumber` **i64** ## getTxOrigin From 64602f6e03721545fb292111829be72ef2cdc6ea Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 21:01:08 +0100 Subject: [PATCH 06/13] EEI: callDataSize is limited to i32 --- eth_interface.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index 619d81e8..2f2b1fc0 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -23,8 +23,8 @@ The Ethereum Environment Interface exposes the following information. Further more we define the following caps on the environmental variables -* `codesize` is capped to a 64 bit integer -* `calldata` size is capped to 64 bits +* `codesize` is capped to a 32 bits +* `calldata` size is capped to 32 bits * `balances` are represented as a 128 bit little endian unsigned integer * `gasPrice` is represented as a 64 bit little endian unsigned integer * `gas` is represented as a 64 bit little endian unsigned integer @@ -127,7 +127,7 @@ data passed with the message call instruction or transaction. **Returns** -`callDataSize` **integer** +`callDataSize` **i32** ## callCode From 22a956ec6cb131e6604b09fc48b0668a5453079c Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 21:01:36 +0100 Subject: [PATCH 07/13] EEI: block timestamp is i64 --- eth_interface.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth_interface.md b/eth_interface.md index 2f2b1fc0..c44061cf 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -422,4 +422,4 @@ Get the block’s timestamp. **Returns** -`blockTimestamp` **integer** +`blockTimestamp` **i64** From c923d1ac8c9b89af2ecea063632978e1ec84845f Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 21:12:47 +0100 Subject: [PATCH 08/13] EEI: define data types --- eth_interface.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eth_interface.md b/eth_interface.md index c44061cf..69755b3b 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -29,6 +29,14 @@ Further more we define the following caps on the environmental variables * `gasPrice` is represented as a 64 bit little endian unsigned integer * `gas` is represented as a 64 bit little endian unsigned integer +# Data types + +We define the following data types: +- `bytes`: an array of bytes with unrestricted length +- `address`: a 160 bit number, represented as a 20 bytes long little endian unsigned integer in memory +- `u128`: a 128 bit number, represented as a 16 bytes long little endian unsigned integer in memory +- `u256`: a 256 bit number, represented as a 32 bytes long little endian unsigned integer in memory + # API ## useGas From b79a20fd6722387e0dd04f6a2f9ef32f9b124084 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 21:17:49 +0100 Subject: [PATCH 09/13] EEI: create must write the resulting address to a location --- eth_interface.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eth_interface.md b/eth_interface.md index 69755b3b..83148ee3 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -270,10 +270,11 @@ Creates a new contract with a given value. - `valueOffset` **i32** the memory offset to load the value from - `dataOffset` **i32** the memory offset to load the code for the new contract from - `length` **i32** the data length +- `resultOffset` **i32** the memory offset to write the new contract address to **Returns** -*nothing* +`result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not ## getBlockDifficulty From 0fe218938df60172d04a374c6b92b1ef3799c2f6 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 21:25:07 +0100 Subject: [PATCH 10/13] EEI: include data type references where appropriate --- eth_interface.md | 82 +++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index 83148ee3..477d0966 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -58,7 +58,7 @@ the given offset. **Parameters** -- `resultOffset` **i32** the memory offset to load the address into +- `resultOffset` **i32** the memory offset to load the address into (`address`) **Returns** @@ -71,8 +71,8 @@ offset. **Parameters** -- `addressOffset` **i32** the memory offset to load the address from -- `resultOffset` **i32** the memory offset to load the balance into +- `addressOffset` **i32** the memory offset to load the address from (`address`) +- `resultOffset` **i32** the memory offset to load the balance into (`u128`) **Returns** @@ -85,7 +85,7 @@ Gets the hash of one of the 256 most recent complete blocks. **Parameters** - `number` **i64** which block to load -- `resultOffset` **i32** the memory offset to load the hash into +- `resultOffset` **i32** the memory offset to load the hash into (`u256`) **Returns** @@ -98,11 +98,11 @@ Sends a message with arbitrary date to a given address path **Parameters** - `gas` **i64** the gas limit -- `addressOffset` **i32** the memory offset to load the address from -- `valueOffset` **i32** the memory offset to load the value from -- `dataOffset` **i32** the memory offset to load data from +- `addressOffset` **i32** the memory offset to load the address from (`address`) +- `valueOffset` **i32** the memory offset to load the value from (`u128`) +- `dataOffset` **i32** the memory offset to load data from (`bytes`) - `dataLength` **i32** the length of data -- `resultOffset` **i32** the memory offset to store the result data at +- `resultOffset` **i32** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data **Returns** @@ -116,7 +116,7 @@ the input data passed with the message call instruction or transaction. **Parameters** -- `resultOffset` **i32** the memory offset to load data into +- `resultOffset` **i32** the memory offset to load data into (`bytes`) - `dataOffset` **i32** the offset in the input data - `length` **i32** the length of data to copy @@ -144,11 +144,11 @@ data passed with the message call instruction or transaction. **Parameters** - `gas` **i64** the gas limit -- `addressOffset` **i32** the memory offset to load the address from -- `valueOffset` **i32** the memory offset to load the value from -- `dataOffset` **i32** the memory offset to load data from +- `addressOffset` **i32** the memory offset to load the address from (`address`) +- `valueOffset` **i32** the memory offset to load the value from (`u128`) +- `dataOffset` **i32** the memory offset to load data from (`bytes`) - `dataLength` **i32** the length of data -- `resultOffset` **i32** the memory offset to store the result data at +- `resultOffset` **i32** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data **Returns** @@ -163,10 +163,10 @@ persisting the current values for sender and value. **Parameters** - `gas` **i64** the gas limit -- `addressOffset` **i32** the memory offset to load the address from -- `dataOffset` **i32** the memory offset to load data from +- `addressOffset` **i32** the memory offset to load the address from (`address`) +- `dataOffset` **i32** the memory offset to load data from (`bytes`) - `dataLength` **i32** the length of data -- `resultOffset` **i32** the memory offset to store the result data at +- `resultOffset` **i32** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data **Returns** @@ -174,24 +174,26 @@ persisting the current values for sender and value. `result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not ## storageStore + Store 256-bit a value in memory to persistent storage **Parameters** -- `pathOffest` **i32** the memory offset to load the path from -- `valueOffset` **i32** the memory offset to load the value from +- `pathOffest` **i32** the memory offset to load the path from (`u256`) +- `valueOffset` **i32** the memory offset to load the value from (`u256`) **Returns** *nothing* ## storageLoad + Loads a 256-bit a value to memory from persistent storage **Parameters** -- `pathOffest` **i32** the memory offset to load the path from -- `resultOffset` **i32** the memory offset to store the result at +- `pathOffest` **i32** the memory offset to load the path from (`u256`) +- `resultOffset` **i32** the memory offset to store the result at (`u256`) **Returns** @@ -204,7 +206,7 @@ the address of the account that is directly responsible for this execution. **Parameters** -- `resultOffset` **i32** the memory offset to load the address into +- `resultOffset` **i32** the memory offset to load the address into (`address`) **Returns** @@ -217,7 +219,7 @@ this execution and loads it into memory at the given location. **Parameters** -- `resultOffset` **i32** the memory offset to load the value into +- `resultOffset` **i32** the memory offset to load the value into (`u128`) **Returns** @@ -229,7 +231,7 @@ Copies the code running in current environment to memory. **Parameters** -- `resultOffset` **i32** the memory offset to load the result into +- `resultOffset` **i32** the memory offset to load the result into (`bytes`) - `codeOffset` **i32** the offset within the code - `length` **i32** the length of code to copy @@ -255,7 +257,7 @@ Gets the block’s beneficiary address and loads into memory. **Parameters** -- `resultOffset` **i32** the memory offset to load the coinbase address into +- `resultOffset` **i32** the memory offset to load the coinbase address into (`address`) **Returns** @@ -267,10 +269,10 @@ Creates a new contract with a given value. **Parameters** -- `valueOffset` **i32** the memory offset to load the value from -- `dataOffset` **i32** the memory offset to load the code for the new contract from +- `valueOffset` **i32** the memory offset to load the value from (`u128`) +- `dataOffset` **i32** the memory offset to load the code for the new contract from (`bytes`) - `length` **i32** the data length -- `resultOffset` **i32** the memory offset to write the new contract address to +- `resultOffset` **i32** the memory offset to write the new contract address to (`address`) **Returns** @@ -282,7 +284,7 @@ Get the block’s difficulty. **Parameters** -- `offset` **i32** the memory offset to load the difficulty into +- `offset` **i32** the memory offset to load the difficulty into (`u256`) **Returns** @@ -294,8 +296,8 @@ Copies the code of an account to memory. **Parameters** -- `addressOffset` **i32** the memory offset to load the address from -- `resultOffset` **i32** the memory offset to load the result into +- `addressOffset` **i32** the memory offset to load the address from (`address`) +- `resultOffset` **i32** the memory offset to load the result into (`bytes`) - `codeOffset` **i32** the offset within the code - `length` **i32** the length of code to copy @@ -309,7 +311,7 @@ Get size of an account’s code. **Parameters** -- `addressOffset` **i32** the memory offset to load the address from +- `addressOffset` **i32** the memory offset to load the address from (`address`) **Returns** @@ -345,7 +347,7 @@ Gets price of gas in current environment. **Parameters** -- `valueOffset` **i32** the memory offset to write the value to +- `valueOffset` **i32** the memory offset to write the value to (`u128`) **Returns** @@ -357,13 +359,13 @@ Creates a new log in the current environment **Parameters** -- `dataOffset` **i32** the memory offset to load data from +- `dataOffset` **i32** the memory offset to load data from (`bytes`) - `length` **i32** the data length - `numberOfTopics` **i32** the number of topics following (0 to 4) -- `topic1` **i32** the memory offset to load topic1 from -- `topic2` **i32** the memory offset to load topic2 from -- `topic3` **i32** the memory offset to load topic3 from -- `topic4` **i32** the memory offset to load topic4 from +- `topic1` **i32** the memory offset to load topic1 from (`u256`) +- `topic2` **i32** the memory offset to load topic2 from (`u256`) +- `topic3` **i32** the memory offset to load topic3 from (`u256`) +- `topic4` **i32** the memory offset to load topic4 from (`u256`) **Returns** @@ -389,7 +391,7 @@ account with non-empty associated code. **Parameters** -- `resultOffset` **i32** the memory offset to load the origin address from +- `resultOffset` **i32** the memory offset to load the origin address from (`address`) **Returns** @@ -401,7 +403,7 @@ Halt execution returning output data. **Parameters** -- `dataOffset` **i32** the memory offset of the output data +- `dataOffset` **i32** the memory offset of the output data (`bytes`) - `length` **i32** the length of the output data **Returns** @@ -415,7 +417,7 @@ balance to an address path **Parameters** -- `addressOffset` **i32** the memory offset to load the address from +- `addressOffset` **i32** the memory offset to load the address from (`address`) **Returns** From 42676bad4adf9884880c30cad451b42f15ae52bd Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 21:29:27 +0100 Subject: [PATCH 11/13] EEI: remove the environment section which repeated with the API --- eth_interface.md | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index 477d0966..5afb285b 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -2,33 +2,6 @@ The Ethereum Environment Interface exposes the core Ethereum API to the eWASM environment. The Ethereum [module](https://github.com/WebAssembly/design/blob/master/Modules.md) will be implemented in the Ethereum client's native language. All parameters and returns are restricted to 32 or 64 bit integers. Floats are disallowed. -## Environment - -The Ethereum Environment Interface exposes the following information. - -* gasCount - the current amount of gas used -* gas - The totally amount of gas that the contract instance has to use -* gasPrice - The price in wei paid for gas -* gasLimit - The max amount of gas that maybe expended -* address - The contract's address -* origin - The origin address of the message that caused this contract to run -* coinbase - The current block's coinbase -* difficulty - The current block's difficulty -* caller - The address that directly messaged this contract -* callValue - The value in wei of that the message has -* callData - The message's data -* code - The code of the current running contract -* logs - All the logs that the contract emitted -* state - Ethereum's state as stored in the state trie - -Further more we define the following caps on the environmental variables - -* `codesize` is capped to a 32 bits -* `calldata` size is capped to 32 bits -* `balances` are represented as a 128 bit little endian unsigned integer -* `gasPrice` is represented as a 64 bit little endian unsigned integer -* `gas` is represented as a 64 bit little endian unsigned integer - # Data types We define the following data types: From eba229ffcea6005681d8b32a698f471788863a7f Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 22:44:53 +0100 Subject: [PATCH 12/13] EEI: make i32ptr stand out --- eth_interface.md | 87 +++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index 5afb285b..44c8130a 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -4,12 +4,17 @@ The Ethereum Environment Interface exposes the core Ethereum API to the eWASM en # Data types -We define the following data types: +We define the following Ethereum data types: - `bytes`: an array of bytes with unrestricted length - `address`: a 160 bit number, represented as a 20 bytes long little endian unsigned integer in memory - `u128`: a 128 bit number, represented as a 16 bytes long little endian unsigned integer in memory - `u256`: a 256 bit number, represented as a 32 bytes long little endian unsigned integer in memory +We also define the following WebAssembly data types: +- `i32`: same as `i32` in WebAssembly +- `i32ptr`: same as `i32` in WebAssembly, but treated as a pointer to a WebAssembly memory offset +- `i64`: same as `i64` in WebAssembly + # API ## useGas @@ -31,7 +36,7 @@ the given offset. **Parameters** -- `resultOffset` **i32** the memory offset to load the address into (`address`) +- `resultOffset` **i32ptr** the memory offset to load the address into (`address`) **Returns** @@ -44,8 +49,8 @@ offset. **Parameters** -- `addressOffset` **i32** the memory offset to load the address from (`address`) -- `resultOffset` **i32** the memory offset to load the balance into (`u128`) +- `addressOffset` **i32ptr** the memory offset to load the address from (`address`) +- `resultOffset` **i32ptr** the memory offset to load the balance into (`u128`) **Returns** @@ -58,7 +63,7 @@ Gets the hash of one of the 256 most recent complete blocks. **Parameters** - `number` **i64** which block to load -- `resultOffset` **i32** the memory offset to load the hash into (`u256`) +- `resultOffset` **i32ptr** the memory offset to load the hash into (`u256`) **Returns** @@ -71,11 +76,11 @@ Sends a message with arbitrary date to a given address path **Parameters** - `gas` **i64** the gas limit -- `addressOffset` **i32** the memory offset to load the address from (`address`) -- `valueOffset` **i32** the memory offset to load the value from (`u128`) -- `dataOffset` **i32** the memory offset to load data from (`bytes`) +- `addressOffset` **i32ptr** the memory offset to load the address from (`address`) +- `valueOffset` **i32ptr** the memory offset to load the value from (`u128`) +- `dataOffset` **i32ptr** the memory offset to load data from (`bytes`) - `dataLength` **i32** the length of data -- `resultOffset` **i32** the memory offset to store the result data at (`bytes`) +- `resultOffset` **i32ptr** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data **Returns** @@ -89,7 +94,7 @@ the input data passed with the message call instruction or transaction. **Parameters** -- `resultOffset` **i32** the memory offset to load data into (`bytes`) +- `resultOffset` **i32ptr** the memory offset to load data into (`bytes`) - `dataOffset` **i32** the offset in the input data - `length` **i32** the length of data to copy @@ -117,11 +122,11 @@ data passed with the message call instruction or transaction. **Parameters** - `gas` **i64** the gas limit -- `addressOffset` **i32** the memory offset to load the address from (`address`) -- `valueOffset` **i32** the memory offset to load the value from (`u128`) -- `dataOffset` **i32** the memory offset to load data from (`bytes`) +- `addressOffset` **i32ptr** the memory offset to load the address from (`address`) +- `valueOffset` **i32ptr** the memory offset to load the value from (`u128`) +- `dataOffset` **i32ptr** the memory offset to load data from (`bytes`) - `dataLength` **i32** the length of data -- `resultOffset` **i32** the memory offset to store the result data at (`bytes`) +- `resultOffset` **i32ptr** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data **Returns** @@ -136,10 +141,10 @@ persisting the current values for sender and value. **Parameters** - `gas` **i64** the gas limit -- `addressOffset` **i32** the memory offset to load the address from (`address`) -- `dataOffset` **i32** the memory offset to load data from (`bytes`) +- `addressOffset` **i32ptr** the memory offset to load the address from (`address`) +- `dataOffset` **i32ptr** the memory offset to load data from (`bytes`) - `dataLength` **i32** the length of data -- `resultOffset` **i32** the memory offset to store the result data at (`bytes`) +- `resultOffset` **i32ptr** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data **Returns** @@ -152,8 +157,8 @@ Store 256-bit a value in memory to persistent storage **Parameters** -- `pathOffest` **i32** the memory offset to load the path from (`u256`) -- `valueOffset` **i32** the memory offset to load the value from (`u256`) +- `pathOffest` **i32ptr** the memory offset to load the path from (`u256`) +- `valueOffset` **i32ptr** the memory offset to load the value from (`u256`) **Returns** @@ -165,8 +170,8 @@ Loads a 256-bit a value to memory from persistent storage **Parameters** -- `pathOffest` **i32** the memory offset to load the path from (`u256`) -- `resultOffset` **i32** the memory offset to store the result at (`u256`) +- `pathOffest` **i32ptr** the memory offset to load the path from (`u256`) +- `resultOffset` **i32ptr** the memory offset to store the result at (`u256`) **Returns** @@ -179,7 +184,7 @@ the address of the account that is directly responsible for this execution. **Parameters** -- `resultOffset` **i32** the memory offset to load the address into (`address`) +- `resultOffset` **i32ptr** the memory offset to load the address into (`address`) **Returns** @@ -192,7 +197,7 @@ this execution and loads it into memory at the given location. **Parameters** -- `resultOffset` **i32** the memory offset to load the value into (`u128`) +- `resultOffset` **i32ptr** the memory offset to load the value into (`u128`) **Returns** @@ -204,7 +209,7 @@ Copies the code running in current environment to memory. **Parameters** -- `resultOffset` **i32** the memory offset to load the result into (`bytes`) +- `resultOffset` **i32ptr** the memory offset to load the result into (`bytes`) - `codeOffset` **i32** the offset within the code - `length` **i32** the length of code to copy @@ -230,7 +235,7 @@ Gets the block’s beneficiary address and loads into memory. **Parameters** -- `resultOffset` **i32** the memory offset to load the coinbase address into (`address`) +- `resultOffset` **i32ptr** the memory offset to load the coinbase address into (`address`) **Returns** @@ -242,10 +247,10 @@ Creates a new contract with a given value. **Parameters** -- `valueOffset` **i32** the memory offset to load the value from (`u128`) -- `dataOffset` **i32** the memory offset to load the code for the new contract from (`bytes`) +- `valueOffset` **i32ptr** the memory offset to load the value from (`u128`) +- `dataOffset` **i32ptr** the memory offset to load the code for the new contract from (`bytes`) - `length` **i32** the data length -- `resultOffset` **i32** the memory offset to write the new contract address to (`address`) +- `resultOffset` **i32ptr** the memory offset to write the new contract address to (`address`) **Returns** @@ -257,7 +262,7 @@ Get the block’s difficulty. **Parameters** -- `offset` **i32** the memory offset to load the difficulty into (`u256`) +- `offset` **i32ptr** the memory offset to load the difficulty into (`u256`) **Returns** @@ -269,8 +274,8 @@ Copies the code of an account to memory. **Parameters** -- `addressOffset` **i32** the memory offset to load the address from (`address`) -- `resultOffset` **i32** the memory offset to load the result into (`bytes`) +- `addressOffset` **i32ptr** the memory offset to load the address from (`address`) +- `resultOffset` **i32ptr** the memory offset to load the result into (`bytes`) - `codeOffset` **i32** the offset within the code - `length` **i32** the length of code to copy @@ -284,7 +289,7 @@ Get size of an account’s code. **Parameters** -- `addressOffset` **i32** the memory offset to load the address from (`address`) +- `addressOffset` **i32ptr** the memory offset to load the address from (`address`) **Returns** @@ -320,7 +325,7 @@ Gets price of gas in current environment. **Parameters** -- `valueOffset` **i32** the memory offset to write the value to (`u128`) +- `valueOffset` **i32ptr** the memory offset to write the value to (`u128`) **Returns** @@ -332,13 +337,13 @@ Creates a new log in the current environment **Parameters** -- `dataOffset` **i32** the memory offset to load data from (`bytes`) +- `dataOffset` **i32ptr** the memory offset to load data from (`bytes`) - `length` **i32** the data length - `numberOfTopics` **i32** the number of topics following (0 to 4) -- `topic1` **i32** the memory offset to load topic1 from (`u256`) -- `topic2` **i32** the memory offset to load topic2 from (`u256`) -- `topic3` **i32** the memory offset to load topic3 from (`u256`) -- `topic4` **i32** the memory offset to load topic4 from (`u256`) +- `topic1` **i32ptr** the memory offset to load topic1 from (`u256`) +- `topic2` **i32ptr** the memory offset to load topic2 from (`u256`) +- `topic3` **i32ptr** the memory offset to load topic3 from (`u256`) +- `topic4` **i32ptr** the memory offset to load topic4 from (`u256`) **Returns** @@ -364,7 +369,7 @@ account with non-empty associated code. **Parameters** -- `resultOffset` **i32** the memory offset to load the origin address from (`address`) +- `resultOffset` **i32ptr** the memory offset to load the origin address from (`address`) **Returns** @@ -376,7 +381,7 @@ Halt execution returning output data. **Parameters** -- `dataOffset` **i32** the memory offset of the output data (`bytes`) +- `dataOffset` **i32ptr** the memory offset of the output data (`bytes`) - `length` **i32** the length of the output data **Returns** @@ -390,7 +395,7 @@ balance to an address path **Parameters** -- `addressOffset` **i32** the memory offset to load the address from (`address`) +- `addressOffset` **i32ptr** the memory offset to load the address from (`address`) **Returns** From 1081aae6003cfbd727b146a8f0c128323a86ffb7 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 Aug 2016 23:31:44 +0100 Subject: [PATCH 13/13] EEI: bump to revision 2 --- eth_interface.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth_interface.md b/eth_interface.md index 44c8130a..61589938 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -1,4 +1,4 @@ -# Ethereum Environment Interface (EEI) Specification (*Revision 1*) +# Ethereum Environment Interface (EEI) Specification (*Revision 2*) The Ethereum Environment Interface exposes the core Ethereum API to the eWASM environment. The Ethereum [module](https://github.com/WebAssembly/design/blob/master/Modules.md) will be implemented in the Ethereum client's native language. All parameters and returns are restricted to 32 or 64 bit integers. Floats are disallowed.