diff --git a/evmc b/evmc index 05819e343d..418461edaa 160000 --- a/evmc +++ b/evmc @@ -1 +1 @@ -Subproject commit 05819e343de23fae05fda0b5a23eeb0da3a320b7 +Subproject commit 418461edaaf25d00921c84f9c29708430be11119 diff --git a/lib/evmone/instructions_traits.hpp b/lib/evmone/instructions_traits.hpp index ccea01b2fb..8d6810d847 100644 --- a/lib/evmone/instructions_traits.hpp +++ b/lib/evmone/instructions_traits.hpp @@ -167,6 +167,8 @@ constexpr inline GasCostTable gas_costs = []() noexcept { table[EVMC_CANCUN][OP_DUPN] = 3; table[EVMC_CANCUN][OP_SWAPN] = 3; + table[EVMC_PRAGUE] = table[EVMC_CANCUN]; + return table; }(); diff --git a/test/integration/CMakeLists.txt b/test/integration/CMakeLists.txt index a8c282ad80..a5b8744a21 100644 --- a/test/integration/CMakeLists.txt +++ b/test/integration/CMakeLists.txt @@ -22,7 +22,7 @@ DUP1,4 add_test(NAME ${PREFIX}/trace COMMAND $ --vm $,trace run 60006002800103) set_tests_properties( ${PREFIX}/trace PROPERTIES PASS_REGULAR_EXPRESSION - "{\"depth\":0,\"rev\":\"London\",\"static\":false} + "{\"depth\":0,\"rev\":\"Paris\",\"static\":false} {\"pc\":0,\"op\":96,\"opName\":\"PUSH1\",\"gas\":1000000,\"stack\":\\[\\],\"memorySize\":0} {\"pc\":2,\"op\":96,\"opName\":\"PUSH1\",\"gas\":999997,\"stack\":\\[\"0x0\"\\],\"memorySize\":0} {\"pc\":4,\"op\":128,\"opName\":\"DUP1\",\"gas\":999994,\"stack\":\\[\"0x0\",\"0x2\"\\],\"memorySize\":0} diff --git a/test/statetest/statetest_loader.cpp b/test/statetest/statetest_loader.cpp index 4a9106014e..b83914ffe4 100644 --- a/test/statetest/statetest_loader.cpp +++ b/test/statetest/statetest_loader.cpp @@ -179,6 +179,10 @@ evmc_revision to_rev(std::string_view s) return EVMC_SHANGHAI; if (s == "Shanghai") return EVMC_SHANGHAI; + if (s == "Cancun") + return EVMC_CANCUN; + if (s == "Prague") + return EVMC_PRAGUE; throw std::invalid_argument{"unknown revision: " + std::string{s}}; } diff --git a/test/unittests/instructions_test.cpp b/test/unittests/instructions_test.cpp index e86550724b..adbf4aac36 100644 --- a/test/unittests/instructions_test.cpp +++ b/test/unittests/instructions_test.cpp @@ -105,7 +105,7 @@ TEST(instructions, compare_with_evmc_instruction_tables) { // Skip DUPN and SWAPN for Cancun. They are not defined in evmc // TODO: Define DUPN and SWAPN in evmc - if (r == EVMC_CANCUN && (Opcode(i) == OP_DUPN || Opcode(i) == OP_SWAPN)) + if (r >= EVMC_CANCUN && (Opcode(i) == OP_DUPN || Opcode(i) == OP_SWAPN)) continue; const auto gas_cost = (instr_tbl[i] != instr::undefined) ? instr_tbl[i] : 0; const auto& metrics = evmone_tbl[i];