Introduce evmc_capabilities and emvc_get_capabilities_fn
@@ -763,6 +763,25 @@ typedef struct evmc_result (*evmc_execute_fn)(struct evmc_instance* instance,
uint8_t const* code,
size_t code_size);
+/**
+ * Possible capabilities of a VM.
+ */
+enum evmc_capabilities
+{
+ EVMC_CAPABILITY_EVM1 = 1, /**< The VM is capable of executing EVM1 bytecode. */
+ EVMC_CAPABILITY_EWASM = 2 /**< The VM is capable of execution ewasm bytecode. */
+};
+
+/**
+ * Return the supported capabilities of the VM instance.
+ *
+ * This function MAY be invoked multiple times for a single VM instance,
+ * and its value MAY be influenced by calls to set_option.
+ *
+ * @param instance The EVM instance.
+ * @return The supported capabilities of the VM, @see ::evmc_capabilities.
+ */
+typedef int (*evmc_get_capabilities_fn)(struct evmc_instance* instance);
/** The opaque type representing a Client-side tracer object. */
struct evmc_tracer_context;
@@ -870,6 +889,16 @@ struct evmc_instance
/** Pointer to function executing a code by the EVM instance. */
evmc_execute_fn execute;
+ /**
+ * Pointer to function returning capabilities supported by the EVM instance.
+ *
+ * The value returned might change when different options are requested via set_option.
+ *
+ * A Client SHOULD only rely on the value returned here if it has queried it after
+ * it has called set_option.
+ */
+ evmc_get_capabilities_fn get_capabilites;
+
/**
* Optional pointer to function setting the EVM instruction tracer.
*
