diff --git a/CHANGELOG.md b/CHANGELOG.md index bd93e8291..45b62c3ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,9 @@ - Deprecated: [[#358](https://github.com/ethereum/evmc/pull/358)] The usage of `evmc/helpers.hpp` has been deprecated. Use `evmc/evmc.hpp` which provides the same features. +- Deprecated: [[#376](https://github.com/ethereum/evmc/pull/376)] + The tracing API has been deprecated as there have been some design flaws discovered. + New API is expected to be introduced in future. - Fixed: [[#261](https://github.com/ethereum/evmc/issues/261), [#263](https://github.com/ethereum/evmc/pull/263)] diff --git a/examples/example_vm/example_vm.c b/examples/example_vm/example_vm.c index 91df9c958..bf0cc3b92 100644 --- a/examples/example_vm/example_vm.c +++ b/examples/example_vm/example_vm.c @@ -22,10 +22,8 @@ /// The example VM instance struct extending the evmc_instance. struct example_vm { - struct evmc_instance instance; ///< The base struct. - int verbose; ///< The verbosity level. - evmc_trace_callback trace_callback; ///< The trace callback. - struct evmc_tracer_context* tracer_context; ///< The tracer context. + struct evmc_instance instance; ///< The base struct. + int verbose; ///< The verbosity level. }; /// The implementation of the evmc_instance::destroy() method. @@ -169,16 +167,6 @@ static struct evmc_result execute(struct evmc_instance* instance, return ret; } -/// The implementation of the optional evmc_instance::set_tracer() method. -static void set_tracer(struct evmc_instance* instance, - evmc_trace_callback callback, - struct evmc_tracer_context* context) -{ - struct example_vm* vm = (struct example_vm*)instance; - vm->trace_callback = callback; - vm->tracer_context = context; -} - /// @cond internal #if !defined(PROJECT_VERSION) @@ -197,7 +185,6 @@ struct evmc_instance* evmc_create_example_vm() .execute = execute, .get_capabilities = get_capabilities, .set_option = set_option, - .set_tracer = set_tracer, }; struct example_vm* vm = calloc(1, sizeof(struct example_vm)); struct evmc_instance* interface = &vm->instance; diff --git a/include/evmc/evmc.h b/include/evmc/evmc.h index de3aab330..872f7c38d 100644 --- a/include/evmc/evmc.h +++ b/include/evmc/evmc.h @@ -991,7 +991,12 @@ struct evmc_instance * Optional pointer to function setting the EVM instruction tracer. * * If the EVM does not support this feature the pointer can be NULL. + * + * @deprecated + * The tracing API from EVMC 6 has been deprecated as there have been some + * design flaws discovered. New API is expected to be introduced in future. */ + EVMC_DEPRECATED evmc_set_tracer_fn set_tracer; /** diff --git a/include/evmc/helpers.h b/include/evmc/helpers.h index e43cfd76a..ca989a405 100644 --- a/include/evmc/helpers.h +++ b/include/evmc/helpers.h @@ -83,12 +83,16 @@ static inline enum evmc_set_option_result evmc_set_option(struct evmc_instance* * * @see evmc_set_tracer_fn */ +EVMC_DEPRECATED static inline void evmc_set_tracer(struct evmc_instance* instance, evmc_trace_callback callback, struct evmc_tracer_context* context) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" if (instance->set_tracer) instance->set_tracer(instance, callback, context); +#pragma GCC diagnostic pop } /** diff --git a/test/vmtester/tests.cpp b/test/vmtester/tests.cpp index cb56e9f97..74c06ce3c 100644 --- a/test/vmtester/tests.cpp +++ b/test/vmtester/tests.cpp @@ -10,6 +10,8 @@ #include #include +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + namespace { // NOTE: this is to avoid compiler optimisations when reading the buffer