Skip to content

Commit

Permalink
Precompile calls were not traced when insuficient gas
Browse files Browse the repository at this point in the history
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
  • Loading branch information
lu-pinto committed Aug 14, 2024
1 parent adf19af commit 8b2f1b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Correct entrypoint in Docker evmtool [#7430](https://github.com/hyperledger/besu/pull/7430)
- Fix protocol schedule check for devnets [#7429](https://github.com/hyperledger/besu/pull/7429)
- Fix behaviour when starting in a pre-merge network [#7431](https://github.com/hyperledger/besu/pull/7431)
- Fix tracing in precompiled contracts when halting for out of gas [#7318](https://github.com/hyperledger/besu/issues/7318)

## 24.7.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class StateDiffGenerator {
public Stream<Trace> generateStateDiff(final TransactionTrace transactionTrace) {
final List<TraceFrame> traceFrames = transactionTrace.getTraceFrames();
if (traceFrames.isEmpty()) {
return Stream.empty();
throw new RuntimeException("expected to have at least one processed frame");
}

// This corresponds to the world state after the TX executed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ private void executePrecompile(
if (frame.getRemainingGas() < gasRequirement) {
frame.setExceptionalHaltReason(Optional.of(ExceptionalHaltReason.INSUFFICIENT_GAS));
frame.setState(MessageFrame.State.EXCEPTIONAL_HALT);
operationTracer.tracePrecompileCall(frame, gasRequirement, null);
} else {
frame.decrementRemainingGas(gasRequirement);
final PrecompiledContract.PrecompileContractResult result =
Expand Down

0 comments on commit 8b2f1b4

Please sign in to comment.