diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ccf5dd30d8..fc2ddb784b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - Added configuration options for `pragueTime` to genesis file for Prague fork development [#6473](https://github.com/hyperledger/besu/pull/6473) - Moving trielog storage to RocksDB's blobdb to improve write amplications [#6289](https://github.com/hyperledger/besu/pull/6289) - Support for `shanghaiTime` fork and Shanghai EVM smart contracts in QBFT/IBFT chains [#6353](https://github.com/hyperledger/besu/pull/6353) +- Change ExecutionHaltReason for contract creation collision case to return ILLEGAL_STATE_CHANGE [#6518](https://github.com/hyperledger/besu/pull/6518) ### Bug fixes - Fix the way an advertised host configured with `--p2p-host` is treated when communicating with the originator of a PING packet [#6225](https://github.com/hyperledger/besu/pull/6225) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/vm/VmTraceGenerator.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/vm/VmTraceGenerator.java index 9800f7d6bd1..74a524fa733 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/vm/VmTraceGenerator.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/vm/VmTraceGenerator.java @@ -107,7 +107,8 @@ private boolean mustIgnore(final TraceFrame frame) { } else if (frame.getExceptionalHaltReason().isPresent()) { final Optional haltReason = frame.getExceptionalHaltReason(); return haltReason.get() != ExceptionalHaltReason.INVALID_JUMP_DESTINATION - && haltReason.get() != ExceptionalHaltReason.INSUFFICIENT_GAS; + && haltReason.get() != ExceptionalHaltReason.INSUFFICIENT_GAS + && haltReason.get() != ExceptionalHaltReason.ILLEGAL_STATE_CHANGE; } else { return frame.isVirtualOperation(); } diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-call/trace_call_14_1_trace.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-call/trace_call_14_1_trace.json index ca583b57783..935a137298c 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-call/trace_call_14_1_trace.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-call/trace_call_14_1_trace.json @@ -41,7 +41,7 @@ "init" : "0x600160015560015460025560ff60005360016000f3", "value" : "0x0" }, - "error" : "Out of gas", + "error" : "Illegal state change", "subtraces" : 0, "traceAddress" : [ 0 ], "type" : "create" diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-callMany/trace_callMany_14_trace.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-callMany/trace_callMany_14_trace.json index 01331d70917..019f701e490 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-callMany/trace_callMany_14_trace.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-callMany/trace_callMany_14_trace.json @@ -82,7 +82,7 @@ "init" : "0x600160015560015460025560ff60005360016000f3", "value" : "0x0" }, - "error" : "Out of gas", + "error" : "Illegal state change", "subtraces" : 0, "traceAddress" : [ 0 ], "type" : "create" diff --git a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-raw-transaction/trace_rawTransaction_14_1_trace.json b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-raw-transaction/trace_rawTransaction_14_1_trace.json index 5dbd9ac84f0..9fc05d054e3 100644 --- a/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-raw-transaction/trace_rawTransaction_14_1_trace.json +++ b/ethereum/api/src/test/resources/org/hyperledger/besu/ethereum/api/jsonrpc/trace/specs/trace-raw-transaction/trace_rawTransaction_14_1_trace.json @@ -34,7 +34,7 @@ "init" : "0x600160015560015460025560ff60005360016000f3", "value" : "0x0" }, - "error" : "Out of gas", + "error" : "Illegal state change", "subtraces" : 0, "traceAddress" : [ 0 ], "type" : "create" diff --git a/evm/src/main/java/org/hyperledger/besu/evm/processor/ContractCreationProcessor.java b/evm/src/main/java/org/hyperledger/besu/evm/processor/ContractCreationProcessor.java index 20daf3ab259..2540648693f 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/processor/ContractCreationProcessor.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/processor/ContractCreationProcessor.java @@ -117,10 +117,10 @@ public void start(final MessageFrame frame, final OperationTracer operationTrace LOG.trace( "Contract creation error: account has already been created for address {}", contractAddress); - frame.setExceptionalHaltReason(Optional.of(ExceptionalHaltReason.INSUFFICIENT_GAS)); + frame.setExceptionalHaltReason(Optional.of(ExceptionalHaltReason.ILLEGAL_STATE_CHANGE)); frame.setState(MessageFrame.State.EXCEPTIONAL_HALT); operationTracer.traceAccountCreationResult( - frame, Optional.of(ExceptionalHaltReason.INSUFFICIENT_GAS)); + frame, Optional.of(ExceptionalHaltReason.ILLEGAL_STATE_CHANGE)); } else { frame.addCreate(contractAddress); contract.incrementBalance(frame.getValue());