Skip to content

Commit

Permalink
rpcdaemon: fix gas cost in case of early failures (#2378)
Browse files Browse the repository at this point in the history
  • Loading branch information
lupin012 authored Sep 27, 2024
1 parent d65aaa4 commit e204306
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rpc-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,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.51.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v0.52.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
cd ${{runner.workspace}}/rpc-tests
pip3 install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion silkworm/rpc/core/evm_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void DebugTracer::on_execution_end(const evmc_result& result, const silkworm::In
case evmc_status_code::EVMC_INVALID_INSTRUCTION:
case evmc_status_code::EVMC_STACK_OVERFLOW:
case evmc_status_code::EVMC_STACK_UNDERFLOW:
log.gas_cost = result.gas_cost;
log.gas_cost = 0;
break;

case evmc_status_code::EVMC_OUT_OF_GAS:
Expand Down
2 changes: 1 addition & 1 deletion silkworm/rpc/core/evm_debug_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ TEST_CASE_METHOD(DebugExecutorTest, "DebugExecutor::execute call with error") {
{
"depth": 1,
"gas": 156080,
"gasCost": 2,
"gasCost": 0,
"memory": [],
"op": "opcode 0x4b not defined",
"pc": 1,
Expand Down

0 comments on commit e204306

Please sign in to comment.