Commit Graph

152 Commits

Author SHA1 Message Date
Paweł Bylica d6224857c4 EVM-C: Collect callbacks in evm_host struct 2017-08-01 15:59:40 +02:00
Paweł Bylica 1349c23167 Add STATICCALL support 2017-07-03 13:17:29 +02:00
Paweł Bylica 0bcc1ca70f Add EVM-C flags to pass STATIC flag for STATICCALL 2017-06-23 17:08:51 +02:00
Paweł Bylica 1bbdc0c0c9 EVM-C: Split get_storage from query callback 2017-06-09 16:16:17 +02:00
Paweł Bylica 34113af8b3 EVM-C: Fix constness, extend examples 2017-06-08 14:48:09 +02:00
Paweł Bylica 4613a0a6b2 EVM-C: Remove address from evm_variant 2017-06-08 12:03:26 +02:00
Paweł Bylica 06b25bf87d EVM-C: Simplify set_storage callback 2017-06-08 12:00:04 +02:00
Paweł Bylica cde8027511 EVM-C: Separate selfdestruct function from state_update one 2017-06-08 11:38:08 +02:00
Paweł Bylica f7e53a12d0 EVM-C: Separate log function from state_update one 2017-06-08 11:07:03 +02:00
Paweł Bylica 497f92bcb8 EVM-C: Replace evm_result payload with 24 bytes union 2017-05-30 12:47:21 +02:00
Paweł Bylica cb90d9f35c EVM-C: change call callback to operate on evm_result type 2017-05-22 16:07:29 +02:00
Paweł Bylica 3ddd4fdc18 Add payload to evm_result (stupid name) 2017-05-11 15:28:57 +02:00
Paweł Bylica a8083aedf4 EVM-C: Update docs 2017-05-08 10:03:48 +02:00
Paweł Bylica 27f3955f8b EVM-C: Add call kind to evm_message 2017-05-04 17:31:30 +01:00
Paweł Bylica 6d6b2c1928 EVM-C: Include code hash in the message 2017-05-04 17:31:30 +01:00
Paweł Bylica cc35c5d169 EVM-C: Improve update state callback function 2017-05-04 17:31:30 +01:00
Paweł Bylica 104a4a12c3 EVM-C: Improve query state callback function 2017-05-04 17:31:30 +01:00
Paweł Bylica 58ad722339 EVM-C: Move blockhash query to own function 2017-05-04 17:31:30 +01:00
Paweł Bylica 25a5fe0ceb EVM-C: Fix C examples 2017-05-04 17:31:30 +01:00
Paweł Bylica da456c0ae6 EVM-C: Remove transaction context items from query key 2017-05-04 17:31:30 +01:00
Paweł Bylica fc096859b9 EVM-C: Query function for transaction context 2017-05-04 17:31:30 +01:00
Paweł Bylica 352942c940 EVM-C: transaction context struct 2017-05-04 17:31:30 +01:00
Paweł Bylica 364bbcd69e EVM-C: clean up evm_query_key
Remove items from evm_query already available in evm_message
2017-05-04 17:31:30 +01:00
Paweł Bylica a5625ee80a EVM-C: Introduce evm_message 2017-05-04 17:31:30 +01:00
Paweł Bylica 6b94734d1a EVM-C: Clarify docs about result context and releasing 2017-04-25 19:05:49 +02:00
Paweł Bylica 7c79af5d59 EVM-C: fix typo in comments 2017-04-25 17:02:49 +02:00
Paweł Bylica 5bab6b8d7e EVM-C: Fix some issues in the example 2017-04-25 17:01:46 +02:00
Paweł Bylica 71dd92123c EVM-C: Clarify UTF-8 encoding of error messages 2017-04-24 18:23:19 +02:00
Paweł Bylica c584b84af9 EVM-C: clarify that evm_result::release can be NULL 2017-04-24 18:10:30 +02:00
Paweł Bylica 1fe60a02ba EVM-C: Simplify and clarify docs of evm_result 2017-04-24 14:00:27 +02:00
Paweł Bylica d3001b92fd Add REVERT opcode support 2017-04-03 18:00:26 +02:00
Paweł Bylica dcf9662874 Add support for Metropolis compatibility mode 2017-04-03 16:13:18 +02:00
Paweł Bylica 67ed0d9bf9 Fix EVM_CALL_FAILURE definition on Windows 2017-01-19 14:32:22 +01:00
Paweł Bylica 96a1a9020b EVM-C: Use enums to represent constants 2017-01-19 14:32:22 +01:00
Paweł Bylica 66b2ae9663 EVM-C: return by explicit output param
In evm_query_fn, return result by explicit output parameter to avoid C ABI issues and inrease portability. C compiler would do the same implicitly.
2017-01-19 14:32:22 +01:00
Paweł Bylica 575337b449 EVM-C: pass callback argument explicitly by pointer
We try to avoid C ABI complex rules like passing structs by value to increase portability.
2017-01-19 14:32:22 +01:00
Paweł Bylica 3d2e365661 EVM-C: introduce factory -- simpler interface
Replace evm_interface with evm_factory. The factory provides ABI protection and the function for creating EVM instances. After the instance is create you can discard the factory as it is no longer needed.
2017-01-19 14:32:22 +01:00
Paweł Bylica bfd39abfb2 EVM-C: Drop address field from evm_result
The evm_result was planned to be used as the return struct of the call callback. The address was added to support CREATE, but it is never used and the union here confuses many languages like Go and Python.
2017-01-19 14:32:21 +01:00
Paweł Bylica 04cb34fb7d EVM-C: separate EXTCODESIZE from EXTCODE(COPY) 2016-12-06 13:47:57 +01:00
Paweł Bylica a4a6b9f60b EVM-C add modes for recent hard forks 2016-11-22 17:39:15 +01:00
Paweł Bylica aceb7af658 EVM-C: reorder and add create_address to evm_result 2016-09-28 13:19:02 +02:00
Paweł Bylica 8b9867c971 EVM-C: Attach result_release function to the result itself 2016-09-27 17:14:19 +02:00
Paweł Bylica 9c2ef341a7 EVM-C: add call depth query 2016-09-26 16:28:12 +02:00
Paweł Bylica 344552bbe1 Move CALL cost calculations to VM
Delegating CALL cost calculations to Env is bad idea and has bugs.
2016-09-14 13:50:45 +02:00
Alex Beregszaszi ce780dd595 EVM-C: use new format for evm_query descriptions 2016-09-01 03:22:23 +01:00
Alex Beregszaszi 4fbe3a05d9 EVM-C: mark empty args as n/a in query/update 2016-09-01 03:08:24 +01:00
Alex Beregszaszi 800e8f531f EVM-C: remove question marks (all fields are defined) 2016-09-01 03:07:18 +01:00
Paweł Bylica 1e28593836 EVM-C: remove note about 8-byte alignment 2016-08-31 13:45:24 +02:00
Paweł Bylica dfd21b50c6 EVM-C: mark the section of the header for Python CFFI 2016-08-31 12:01:28 +02:00
Paweł Bylica 04ddc0fb93 EVM-C: update docs 2016-08-31 12:00:40 +02:00
Paweł Bylica 2a99b13573 EVM-C: Replace evm_{uint|hash}256 with single evm_uint256be
All values transfered to/from a VM must be passed as big-endian integers.
2016-08-31 11:40:02 +02:00
Paweł Bylica 4b650928bb EVM-C: Avoid examplevm_get_interface() being implicitly variadic 2016-08-29 10:37:46 +02:00
Paweł Bylica 12efc07993 EVM-C: Extend docs of evm_update_fn 2016-08-29 09:30:19 +02:00
Paweł Bylica 1c4ba40573 Fix type in EVM-C docs. NFC 2016-08-29 09:06:47 +02:00
Paweł Bylica e70eae3e7a EVM-C: evm_prepare_code(): move code_hash parameter before code parameter 2016-08-28 20:40:27 +02:00
Paweł Bylica 0b9b01e05c EVM-C: Simplify evm_hash256 struct 2016-08-28 20:40:20 +02:00
Paweł Bylica aa1fa5ee32 EVM-C: Add ABI versioning support 2016-08-25 22:02:36 +02:00
Paweł Bylica 93f16f9380 EVM-C: Drop evm_get_info() 2016-08-25 15:01:49 +02:00
Paweł Bylica 2e6b278a59 EVM-C: Rename evm_result_error_code -> evm_result_code 2016-08-25 13:50:11 +02:00
Paweł Bylica 85ee6de4be EVM-C: Update docs 2016-08-25 12:48:54 +02:00
Paweł Bylica b889ea4daa EVM-C: Change #define EVM_CALL_FAILURE to static const global variable 2016-08-25 12:40:16 +02:00
Paweł Bylica cd72d30018 EVM-C: Extend evm_result 2016-08-25 12:11:24 +02:00
Alex Beregszaszi 971033adda EVM-C: start result codes from 1 2016-08-24 12:40:55 +01:00
Alex Beregszaszi baeade4d10 EVM-C: rename EVM_RESULT_* to EVM_* 2016-08-24 12:30:52 +01:00
Alex Beregszaszi f107589c59 EVM-C: rename EVM_EXCEPTION to EVM_CALL_EXCEPTION 2016-08-24 12:30:51 +01:00
Alex Beregszaszi 9046d6edd5 EVM-C: include the rest of the result codes from cpp-ethereum 2016-08-24 11:02:59 +01:00
Alex Beregszaszi 75f257a3a7 EVM-C: include last_pc in evm_result 2016-08-24 10:47:17 +01:00
Alex Beregszaszi 0e129f5fed EVM-C: demote EVM_EXCEPTION to only be used with evm_query_fn 2016-08-24 10:47:17 +01:00
Alex Beregszaszi abc914afd2 EVM-C: include evm_result_outcome in evm_result 2016-08-24 10:47:17 +01:00
Paweł Bylica 530b6684b2 EVM-C: Rename evm_fn_table -> evm_interface 2016-08-23 21:51:42 +02:00
Paweł Bylica 81edf123db EVM-C: Replace #pargma once with #ifndef include guards 2016-08-23 20:04:08 +02:00
Paweł Bylica c4b226a035 EVM-C: Move evmjit to separated header & update docs 2016-08-23 13:50:25 +02:00
Paweł Bylica efb73335c2 Update EVM-C examples 2016-08-23 13:07:33 +02:00
Paweł Bylica 5defa1d222 EVM-C: Support multiple implementation
Support multiple VM implementations by EVM-C in a single application by exporting only a function table (like vtable in OOP) for each implementation. The symbol name convention is `<vm-name>_get_fn_table()`.
2016-08-23 12:09:39 +02:00
Paweł Bylica 77326672fd EVM-C: Use int istead of bool type 2016-08-23 11:55:06 +02:00
Paweł Bylica 091963ce09 Merge remote-tracking branch 'origin/develop' into evmc
# Conflicts:
#	examples/capi.c
2016-08-23 09:37:15 +02:00
Paweł Bylica 609b6b2390 EVM-C: rename evm_release_result_resources() -> evm_release_result() 2016-08-23 00:54:46 +02:00
Alex Beregszaszi 8ae6f4eae6 EVM-C: mark evm_hash160 big-endian 2016-08-22 21:37:30 +01:00
Alex Beregszaszi 9c3ff6d4b3 EVM-C: response is 20 bytes address to CREATE (and not 160 bytes) 2016-08-22 21:37:30 +01:00
Alex Beregszaszi 787644293c EVM-C: highlight CREATE in evm_call_fn 2016-08-22 21:37:30 +01:00
Alex Beregszaszi 2b46c72c39 EVM-C: trying to fix Doxygen for evm_update_fn 2016-08-22 21:37:30 +01:00
Paweł Bylica 70be53cf4d EVM-C: better names for functions supporting JITs
Rename evmjit_is_code_ready() to evm_get_code_status() and evmjit_compile() to evm_prepare_code().
2016-08-22 22:18:42 +02:00
Paweł Bylica 2b6773f128 EVM-C: Change evm_destroy_result() to evm_release_result_resources()
Be explicit how releasing execution result works. Also pass result by pointer.
2016-08-22 21:40:20 +02:00
Alex Beregszaszi 5c5c7087af EVM-C: use evm_variant::data for EVM_CODE_BY_ADDRESS so that Doxygen picks it up correctly 2016-08-22 12:06:15 +01:00
Alex Beregszaszi d14fd8563f EVM-C: update description of evm_query_fn to match current implementation 2016-08-22 12:06:15 +01:00
Alex Beregszaszi ce75278de7 EMV-C: include description for evm_update_fn 2016-08-22 11:42:07 +01:00
Alex Beregszaszi d529efcf00 EVM-C: include struct keyword where types are not typedef'd 2016-08-22 11:42:07 +01:00
Paweł Bylica a4bb85250d EVM-C: allow correct symbol exporting
This is a bit strange but MSVC requires dllexport spec to be applied to some (not all) function declarations. So the evm.h header will now use EXPORT macro for that if that macro is defined by the implementation.
2016-07-29 13:14:12 +02:00
Paweł Bylica 2f68fdf592 EVM-C: improve enums
Explicitly enumarate enum members to be easier to use by langugaes not supporting C enums (like Python ctypes module).
2016-07-29 12:07:11 +02:00
Paweł Bylica 0fea9c9094 EVM-C: Move evm_mode param directly to evm_execute() 2016-07-28 12:45:01 +02:00
Paweł Bylica ae3d37d361 EVM-C: Use unsigned char (uint8_t) to reference arrays of bytes 2016-07-26 14:00:59 +02:00
Paweł Bylica 180fa2b23e Extend EVM-C with code compilation support suitable for jits 2016-07-26 13:31:04 +02:00
Paweł Bylica d26635abc2 EVM-C: get rid of evm_bytes_view type 2016-07-20 14:15:04 +02:00
Paweł Bylica a7bfe3d201 Implement CREATE using evm_call() function form EVM-C API 2016-07-15 16:40:34 +02:00
Paweł Bylica 9869772ad7 EVM-C: use EVM_EXCEPTION constant as a call failure indicator 2016-07-15 14:37:06 +02:00
Paweł Bylica f92ce99a5a Simplify evm_call_fn of EVM-C and fix C ABI calls 2016-07-15 14:21:02 +02:00
Paweł Bylica c83060626f Implement calls using evm_call() function form EVM-C API 2016-07-14 16:56:16 +02:00
Paweł Bylica 4198c0d503 EVM-C: Pass logs using evm_update() function 2016-07-05 13:18:36 +02:00
Paweł Bylica 4d0fd3e24e EVM-C: Register selfdestruction by evm_update()
This allows simplifying the return structure.
2016-07-05 00:55:04 +02:00
Paweł Bylica c7d4a57a90 EVM-C: Change store_storage() to update() function
Change store_storage() function to more generic update() function for modifying a contract state. The update() function is going to be used also for logs and selfdesctruction.
2016-07-05 00:03:25 +02:00