From 37863f63b8cb0e06edb0f17c390d0bb0d3410946 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sun, 14 Jan 2018 13:32:49 +0000 Subject: [PATCH 1/3] EVM-C: mention that selfdestruct doesn't end execution --- include/evm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/evm.h b/include/evm.h index 0e3400e..10d089c 100644 --- a/include/evm.h +++ b/include/evm.h @@ -322,6 +322,8 @@ typedef size_t (*evm_get_code_fn)(const uint8_t** result_code, /// Selfdestruct callback function. /// /// This callback function is used by an EVM to SELFDESTRUCT given contract. +/// The execution of the contract will not be stopped, that is up to the EVM. +/// /// @param context The pointer to the Host execution context. /// @see ::evm_context. /// @param address The address of the contract to be selfdestructed. From 1b667d7b7461dc3cdeafdd9326f2569ef9b1b9d4 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sun, 14 Jan 2018 13:33:38 +0000 Subject: [PATCH 2/3] EVM-C: mention that the client frees the buffer in get_code_fn --- include/evm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/evm.h b/include/evm.h index 10d089c..eb5864a 100644 --- a/include/evm.h +++ b/include/evm.h @@ -308,9 +308,10 @@ typedef void (*evm_get_balance_fn)(struct evm_uint256be* result, /// /// This callback function is used by an EVM to get the code of a contract of /// given address. +/// /// @param[out] result_code The pointer to the contract code. This argument is /// optional. If NULL is provided, the host MUST only -/// return the code size. +/// return the code size. It will be freed by the Client. /// @param context The pointer to the Host execution context. /// @see ::evm_context. /// @param address The address of the contract. From dd291283602ea505a49e263445a01470c7b9e53b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sun, 14 Jan 2018 13:36:42 +0000 Subject: [PATCH 3/3] EVM-C: document get_tx_context and get_block_has --- include/evm.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/evm.h b/include/evm.h index eb5864a..84fee65 100644 --- a/include/evm.h +++ b/include/evm.h @@ -107,9 +107,27 @@ struct evm_tx_context { struct evm_context; +/// Get transaction context callback function. +/// +/// This callback function is used by an EVM to retrieve the transaction and +/// block context. +/// +/// @param[out] result The returned transaction context. +/// @see ::evm_tx_context. +/// @param context The pointer to the Host execution context. +/// @see ::evm_context. typedef void (*evm_get_tx_context_fn)(struct evm_tx_context* result, struct evm_context* context); +/// Get block hash callback function.. +/// +/// This callback function is used by an EVM to query the block hash of +/// a given block. +/// +/// @param[out] result The returned block hash value. +/// @param context The pointer to the Host execution context. +/// @param number The block number. Must be a value between +// (and including) 0 and 255. typedef void (*evm_get_block_hash_fn)(struct evm_uint256be* result, struct evm_context* context, int64_t number);