From 67889b528f32dae025efec831be3b0b6923c0f28 Mon Sep 17 00:00:00 2001 From: Sixtysixter <20945591+Sixtysixter@users.noreply.github.com> Date: Sun, 1 Sep 2024 22:36:15 +0200 Subject: [PATCH] rpcdaemon: fix gas_cost and memory of last STOP opcode in debug API (#2281) --- .github/workflows/rpc-integration-tests.yml | 2 +- silkworm/rpc/core/evm_debug.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rpc-integration-tests.yml b/.github/workflows/rpc-integration-tests.yml index 722f076075..b7bba39c25 100644 --- a/.github/workflows/rpc-integration-tests.yml +++ b/.github/workflows/rpc-integration-tests.yml @@ -27,7 +27,7 @@ jobs: - name: Checkout RPC Tests Repository & Install Requirements run: | rm -rf ${{runner.workspace}}/rpc-tests - git -c advice.detachedHead=false clone --depth 1 --branch v0.43.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests + git -c advice.detachedHead=false clone --depth 1 --branch v0.44.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests cd ${{runner.workspace}}/rpc-tests pip3 install -r requirements.txt diff --git a/silkworm/rpc/core/evm_debug.cpp b/silkworm/rpc/core/evm_debug.cpp index 1fef2d6c60..045f0a4b3d 100644 --- a/silkworm/rpc/core/evm_debug.cpp +++ b/silkworm/rpc/core/evm_debug.cpp @@ -275,9 +275,10 @@ void DebugTracer::on_execution_end(const evmc_result& result, const silkworm::In DebugLog newlog; newlog.pc = log.pc + 1; newlog.op = get_opcode_name(opcode_names_, OP_STOP); - newlog.gas = log.gas; + newlog.gas = log.gas - log.gas_cost; newlog.gas_cost = 0; newlog.depth = log.depth; + newlog.memory = log.memory; logs_.push_back(newlog); } }