diff --git a/test/evmc/README.md b/test/evmc/README.md index 6b7f76f61..cdddb3444 100644 --- a/test/evmc/README.md +++ b/test/evmc/README.md @@ -1,5 +1,5 @@ # EVMC -This is an import of [EVMC](https://github.com/ethereum/evmc) version [10.0.0](https://github.com/ethereum/evmc/releases/tag/v10.0.0). +This is an import of [EVMC](https://github.com/ethereum/evmc) version [10.1.0](https://github.com/ethereum/evmc/releases/tag/v10.1.0). -Important: The `MockedAccount.storage` is changed to a map from unordered_map as ordering is important for fuzzing. +Important: The `MockedAccount.storage` is changed to a `map` from `unordered_map` as ordering is important for fuzzing. diff --git a/test/evmc/evmc.h b/test/evmc/evmc.h index 16d568660..60c3aeecc 100644 --- a/test/evmc/evmc.h +++ b/test/evmc/evmc.h @@ -412,20 +412,21 @@ struct evmc_result /** * The reference to output data. * - * The output contains data coming from RETURN opcode (iff evmc_result::code - * field is ::EVMC_SUCCESS) or from REVERT opcode. + * The output contains data coming from RETURN opcode (iff evmc_result::code + * field is ::EVMC_SUCCESS) or from REVERT opcode. * - * The memory containing the output data is owned by EVM and has to be - * freed with evmc_result::release(). + * The memory containing the output data is owned by EVM and has to be + * freed with evmc_result::release(). * - * This MAY be NULL. + * This pointer MAY be NULL. + * If evmc_result::output_size is 0 this pointer MUST NOT be dereferenced. */ const uint8_t* output_data; /** * The size of the output data. * - * If output_data is NULL this MUST be 0. + * If evmc_result::output_data is NULL this MUST be 0. */ size_t output_size; @@ -463,13 +464,13 @@ struct evmc_result /** * Reserved data that MAY be used by a evmc_result object creator. * - * This reserved 4 bytes together with 20 bytes from create_address form - * 24 bytes of memory called "optional data" within evmc_result struct - * to be optionally used by the evmc_result object creator. + * This reserved 4 bytes together with 20 bytes from create_address form + * 24 bytes of memory called "optional data" within evmc_result struct + * to be optionally used by the evmc_result object creator. * - * @see evmc_result_optional_data, evmc_get_optional_data(). + * @see evmc_result_optional_data, evmc_get_optional_data(). * - * Also extends the size of the evmc_result to 64 bytes (full cache line). + * Also extends the size of the evmc_result to 64 bytes (full cache line). */ uint8_t padding[4]; }; @@ -963,18 +964,26 @@ enum evmc_revision * The Cancun revision. * * The future next revision after Shanghai. + * https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md */ EVMC_CANCUN = 12, + /** + * The Prague revision. + * + * The future next revision after Cancun. + */ + EVMC_PRAGUE = 13, + /** The maximum EVM revision supported. */ - EVMC_MAX_REVISION = EVMC_CANCUN, + EVMC_MAX_REVISION = EVMC_PRAGUE, /** * The latest known EVM revision with finalized specification. * * This is handy for EVM tools to always use the latest revision available. */ - EVMC_LATEST_STABLE_REVISION = EVMC_LONDON + EVMC_LATEST_STABLE_REVISION = EVMC_SHANGHAI }; @@ -1111,7 +1120,7 @@ struct evmc_vm /** * Optional pointer to function modifying VM's options. * - * If the VM does not support this feature the pointer can be NULL. + * If the VM does not support this feature the pointer can be NULL. */ evmc_set_option_fn set_option; }; diff --git a/test/evmc/evmc.hpp b/test/evmc/evmc.hpp index 3d336894f..a29f802d2 100644 --- a/test/evmc/evmc.hpp +++ b/test/evmc/evmc.hpp @@ -414,6 +414,12 @@ public: return *this; } + /// Access the result object as a referenced to ::evmc_result. + evmc_result& raw() noexcept { return *this; } + + /// Access the result object as a const referenced to ::evmc_result. + const evmc_result& raw() const noexcept { return *this; } + /// Releases the ownership and returns the raw copy of evmc_result. /// /// This method drops the ownership of the result diff --git a/test/evmc/helpers.h b/test/evmc/helpers.h index 17db3d194..683567ef1 100644 --- a/test/evmc/helpers.h +++ b/test/evmc/helpers.h @@ -20,9 +20,11 @@ #ifdef __cplusplus extern "C" { +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" #endif +#endif /** * Returns true if the VM has a compatible ABI version. @@ -297,6 +299,8 @@ static inline const char* evmc_revision_to_string(enum evmc_revision rev) return "Shanghai"; case EVMC_CANCUN: return "Cancun"; + case EVMC_PRAGUE: + return "Prague"; } return ""; } @@ -304,6 +308,8 @@ static inline const char* evmc_revision_to_string(enum evmc_revision rev) /** @} */ #ifdef __cplusplus +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif } // extern "C" #endif diff --git a/test/evmc/mocked_host.hpp b/test/evmc/mocked_host.hpp index 0e4ee824f..173b793ac 100644 --- a/test/evmc/mocked_host.hpp +++ b/test/evmc/mocked_host.hpp @@ -6,8 +6,8 @@ #include #include #include -#include #include +#include #include #include