Upgrade to evmc 10.1.0

This commit is contained in:
Alex Beregszaszi 2023-04-23 15:50:16 +02:00
parent b75bddbd11
commit ee92491aae
5 changed files with 38 additions and 17 deletions

View File

@ -1,5 +1,5 @@
# EVMC # 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.

View File

@ -418,14 +418,15 @@ struct evmc_result
* The memory containing the output data is owned by EVM and has to be * The memory containing the output data is owned by EVM and has to be
* freed with evmc_result::release(). * 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; const uint8_t* output_data;
/** /**
* The size of the 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; size_t output_size;
@ -963,18 +964,26 @@ enum evmc_revision
* The Cancun revision. * The Cancun revision.
* *
* The future next revision after Shanghai. * The future next revision after Shanghai.
* https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md
*/ */
EVMC_CANCUN = 12, EVMC_CANCUN = 12,
/**
* The Prague revision.
*
* The future next revision after Cancun.
*/
EVMC_PRAGUE = 13,
/** The maximum EVM revision supported. */ /** The maximum EVM revision supported. */
EVMC_MAX_REVISION = EVMC_CANCUN, EVMC_MAX_REVISION = EVMC_PRAGUE,
/** /**
* The latest known EVM revision with finalized specification. * The latest known EVM revision with finalized specification.
* *
* This is handy for EVM tools to always use the latest revision available. * 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
}; };

View File

@ -414,6 +414,12 @@ public:
return *this; 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. /// Releases the ownership and returns the raw copy of evmc_result.
/// ///
/// This method drops the ownership of the result /// This method drops the ownership of the result

View File

@ -20,9 +20,11 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#ifdef __GNUC__
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wold-style-cast"
#endif #endif
#endif
/** /**
* Returns true if the VM has a compatible ABI version. * 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"; return "Shanghai";
case EVMC_CANCUN: case EVMC_CANCUN:
return "Cancun"; return "Cancun";
case EVMC_PRAGUE:
return "Prague";
} }
return "<unknown>"; return "<unknown>";
} }
@ -304,6 +308,8 @@ static inline const char* evmc_revision_to_string(enum evmc_revision rev)
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
#ifdef __GNUC__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif
} // extern "C" } // extern "C"
#endif #endif

View File

@ -6,8 +6,8 @@
#include <evmc/evmc.hpp> #include <evmc/evmc.hpp>
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <string>
#include <map> #include <map>
#include <string>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>