Skip to content

Commit

Permalink
Fix incorrect gas consumption with verbosity > 3 (#1077)
Browse files Browse the repository at this point in the history
  • Loading branch information
dungeon-master-666 authored Jul 26, 2024
1 parent 1b93728 commit a5521a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crypto/vm/vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,16 @@ int VmState::step() {
if (log.log_mask & vm::VmLog::DumpStackVerbose) {
mode += 4;
}
std::unique_ptr<VmStateInterface> tmp_ctx;
// install temporary dummy vm state interface to prevent charging for cell load operations during dump
VmStateInterface::Guard guard(tmp_ctx.get());
stack->dump(ss, mode);
VM_LOG(this) << "stack:" << ss.str();
}
if (stack_trace) {
std::unique_ptr<VmStateInterface> tmp_ctx;
// install temporary dummy vm state interface to prevent charging for cell load operations during dump
VmStateInterface::Guard guard(tmp_ctx.get());
stack->dump(std::cerr, 3);
}
++steps;
Expand Down

0 comments on commit a5521a6

Please sign in to comment.