diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 1f91db8d66..fab96cd544 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.9.0-dev +current_version = 0.9.0 tag = True sign_tags = True tag_message = evmone {new_version} diff --git a/CHANGELOG.md b/CHANGELOG.md index f91bbd220e..4afb6e9dd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,14 @@ Documentation of all notable changes to the **evmone** project. The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning]. +## [0.9.1] — 2022-09-07 -## [0.9.0] — unreleased +### Fixed + +- Resetting gas refund counter when execution state is reused. + [#504](https://github.com/ethereum/evmone/pull/504) + +## [0.9.0] — 2022-08-30 In this release we have been focused on improving performance of the Baseline interpreter. The end result is that the Baseline is **26% faster** than in previous version 0.8.0 @@ -347,7 +353,7 @@ It delivers fully-compatible and high-speed EVM implementation. - The [intx 0.2.0](https://github.com/chfast/intx/releases/tag/v0.2.0) library is used for 256-bit precision arithmetic. -[0.9.0]: https://github.com/ethereum/evmone/compare/v0.8.2..master +[0.9.0]: https://github.com/ethereum/evmone/releases/tag/v0.9.0 [0.8.2]: https://github.com/ethereum/evmone/releases/tag/v0.8.2 [0.8.1]: https://github.com/ethereum/evmone/releases/tag/v0.8.1 [0.8.0]: https://github.com/ethereum/evmone/releases/tag/v0.8.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index a9bb7f4593..ede8035e56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ cable_set_build_type(DEFAULT Release CONFIGURATION_TYPES Release Debug) include(Hunter/init) project(evmone LANGUAGES CXX C) -set(PROJECT_VERSION 0.9.0-dev) +set(PROJECT_VERSION 0.9.0) string(REGEX MATCH "([0-9]+)\\.([0-9]+)" _ ${PROJECT_VERSION}) set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1}) diff --git a/lib/evmone/execution_state.hpp b/lib/evmone/execution_state.hpp index 3734539171..1ab0528867 100644 --- a/lib/evmone/execution_state.hpp +++ b/lib/evmone/execution_state.hpp @@ -183,6 +183,7 @@ class ExecutionState bytes_view _code) noexcept { gas_left = message.gas; + gas_refund = 0; memory.clear(); msg = &message; host = {host_interface, host_ctx}; diff --git a/test/unittests/execution_state_test.cpp b/test/unittests/execution_state_test.cpp index 4c37ba9930..832021e488 100644 --- a/test/unittests/execution_state_test.cpp +++ b/test/unittests/execution_state_test.cpp @@ -84,6 +84,7 @@ TEST(execution_state, reset_advanced) evmone::advanced::AdvancedExecutionState st; st.gas_left = 1; + st.gas_refund = 2; st.stack.push({}); st.memory.grow(64); st.msg = &msg; @@ -97,6 +98,7 @@ TEST(execution_state, reset_advanced) st.analysis.advanced = &analysis; EXPECT_EQ(st.gas_left, 1); + EXPECT_EQ(st.gas_refund, 2); EXPECT_EQ(st.stack.size(), 1); EXPECT_EQ(st.memory.size(), 64); EXPECT_EQ(st.msg, &msg); @@ -121,6 +123,7 @@ TEST(execution_state, reset_advanced) // TODO: We are not able to test HostContext with current API. It may require an execution // test. EXPECT_EQ(st.gas_left, 13); + EXPECT_EQ(st.gas_refund, 0); EXPECT_EQ(st.stack.size(), 0); EXPECT_EQ(st.memory.size(), 0); EXPECT_EQ(st.msg, &msg2);