diff --git a/silkworm/silkrpc/core/evm_trace.cpp b/silkworm/silkrpc/core/evm_trace.cpp index 38fc5ba6..9b18591c 100644 --- a/silkworm/silkrpc/core/evm_trace.cpp +++ b/silkworm/silkrpc/core/evm_trace.cpp @@ -716,7 +716,7 @@ void TraceTracer::on_execution_start(evmc_revision rev, const evmc_message& msg, current_depth_ = msg.depth; - auto create = (!initial_ibs_.exists(recipient) && created_address_.find(recipient) == created_address_.end() && recipient != code_address); + auto create = ((initial_ibs_.get_nonce(recipient) == 0 && initial_ibs_.get_code_hash(recipient) == kEmptyHash) && created_address_.find(recipient) == created_address_.end() && recipient != code_address); start_gas_.push(msg.gas); @@ -1675,7 +1675,7 @@ void CreateTracer::on_execution_start(evmc_revision, const evmc_message& msg, ev auto recipient = evmc::address{msg.recipient}; auto code_address = evmc::address{msg.code_address}; - bool create = (!initial_ibs_.exists(recipient) && recipient != code_address); + bool create = ((initial_ibs_.get_nonce(recipient) == 0 && initial_ibs_.get_code_hash(recipient) == kEmptyHash) && recipient != code_address); if (create && recipient == contract_address_) { this->found_ = true; @@ -1696,7 +1696,8 @@ void EntryTracer::on_execution_start(evmc_revision, const evmc_message& msg, evm auto sender = evmc::address{msg.sender}; auto recipient = evmc::address{msg.recipient}; auto code_address = evmc::address{msg.code_address}; - bool create = (!initial_ibs_.exists(recipient) && recipient != code_address); + + bool create = ((initial_ibs_.get_nonce(recipient) == 0 && initial_ibs_.get_code_hash(recipient) == kEmptyHash) && recipient != code_address); auto input = silkworm::ByteView{msg.input_data, msg.input_size}; auto str_value = "0x" + intx::hex(intx::be::load<intx::uint256>(msg.value)); @@ -1753,7 +1754,7 @@ void OperationTracer::on_execution_start(evmc_revision, const evmc_message& msg, auto depth = msg.depth; auto kind = msg.kind; - bool create = (!initial_ibs_.exists(recipient) && recipient != code_address); + bool create = ((initial_ibs_.get_nonce(recipient) == 0 && initial_ibs_.get_code_hash(recipient) == kEmptyHash) && recipient != code_address); auto str_value = "0x" + intx::hex(intx::be::load<intx::uint256>(msg.value)); if (create && msg.depth > 0) { diff --git a/silkworm/silkrpc/core/evm_trace_test.cpp b/silkworm/silkrpc/core/evm_trace_test.cpp index ac153c0f..66e0cc7b 100644 --- a/silkworm/silkrpc/core/evm_trace_test.cpp +++ b/silkworm/silkrpc/core/evm_trace_test.cpp @@ -1458,21 +1458,21 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_call with erro "storage": {} } }, - "trace": [ + "trace":[ { - "action": { - "callType": "call", - "from": "0x578f0a154b23be77fc2033197fbc775637648ad4", - "gas": "0x261b2", - "input": "0x", - "to": "0x6951c35e335fa18c97cb207119133cd8009580cd", - "value": "0x0" - }, - "error": "bad instruction", - "result": null, - "subtraces": 0, - "traceAddress": [], - "type": "call" + "action":{ + "from":"0x578f0a154b23be77fc2033197fbc775637648ad4", + "gas":"0x261b2", + "init":"0x414bf3890000000000000000000000009d381f0b1637475f133c92d9b9fdc5493ae19b630000000000000000000000009b73fc193bfa16abe18d1ea30734e4a6444a753f0000000000000000000000000000000000000000000000000000000000002710000000000000000000000000578f0a154b23be77fc2033197fbc775637648ad400000000000000000000000000000000000000000000000000000000612ba19c00000000000000000000000000000000000000000001a784379d99db4200000000000000000000000000000000000000000000000002cdc48e6cca575707722c0000000000000000000000000000000000000000000000000000000000000000", + "value":"0x0" + }, + "error":"bad instruction", + "result":null, + "subtraces":0, + "traceAddress":[ + + ], + "type":"create" } ], "vmTrace": {