@@ -36,7 +36,6 @@ consteval evmc_call_kind to_call_kind(Opcode op) noexcept
3636 case OP_CREATE2:
3737 return EVMC_CREATE2;
3838 case OP_EOFCREATE:
39- case OP_TXCREATE:
4039 return EVMC_EOFCREATE;
4140 default :
4241 intx::unreachable ();
@@ -332,17 +331,12 @@ Result create_impl(StackTop stack, int64_t gas_left, ExecutionState& state) noex
332331 return {EVMC_SUCCESS, gas_left};
333332}
334333
335- template <Opcode Op>
336- Result create_eof_impl (
334+ Result eofcreate (
337335 StackTop stack, int64_t gas_left, ExecutionState& state, code_iterator& pos) noexcept
338336{
339- static_assert (Op == OP_EOFCREATE || Op == OP_TXCREATE);
340-
341337 if (state.in_static_mode ())
342338 return {EVMC_STATIC_MODE_VIOLATION, gas_left};
343339
344- const auto initcode_hash =
345- (Op == OP_TXCREATE) ? intx::be::store<evmc::bytes32>(stack.pop ()) : evmc::bytes32{};
346340 const auto endowment = stack.pop ();
347341 const auto salt = stack.pop ();
348342 const auto input_offset_u256 = stack.pop ();
@@ -354,32 +348,11 @@ Result create_eof_impl(
354348 if (!check_memory (gas_left, state.memory , input_offset_u256, input_size_u256))
355349 return {EVMC_OUT_OF_GAS, gas_left};
356350
357- bytes_view initcontainer;
358- if constexpr (Op == OP_EOFCREATE)
359- {
360- const auto initcontainer_index = pos[1 ];
361- pos += 2 ;
362- const auto & container = state.original_code ;
363- const auto & eof_header = state.analysis .baseline ->eof_header ;
364- initcontainer = eof_header.get_container (container, initcontainer_index);
365- }
366- else
367- {
368- pos += 1 ;
369-
370- initcontainer = state.get_tx_initcode_by_hash (initcode_hash);
371- // In case initcode was not found, empty bytes_view was returned.
372- // Transaction initcodes are not allowed to be empty.
373- if (initcontainer.empty ())
374- return {EVMC_SUCCESS, gas_left}; // "Light" failure
375-
376- // Charge for initcode validation.
377- constexpr auto initcode_word_cost_validation = 2 ;
378- const auto initcode_cost_validation =
379- num_words (initcontainer.size ()) * initcode_word_cost_validation;
380- if ((gas_left -= initcode_cost_validation) < 0 )
381- return {EVMC_OUT_OF_GAS, gas_left};
382- }
351+ const auto initcontainer_index = pos[1 ];
352+ pos += 2 ;
353+ const auto & container = state.original_code ;
354+ const auto & eof_header = state.analysis .baseline ->eof_header ;
355+ const auto initcontainer = eof_header.get_container (container, initcontainer_index);
383356
384357 // Charge for initcode hashing.
385358 constexpr auto initcode_word_cost_hashing = 6 ;
@@ -397,14 +370,7 @@ Result create_eof_impl(
397370 intx::be::load<uint256>(state.host .get_balance (state.msg ->recipient )) < endowment)
398371 return {EVMC_SUCCESS, gas_left}; // "Light" failure.
399372
400- if constexpr (Op == OP_TXCREATE)
401- {
402- const auto error_subcont = validate_eof (state.rev , ContainerKind::initcode, initcontainer);
403- if (error_subcont != EOFValidationError::success)
404- return {EVMC_SUCCESS, gas_left}; // "Light" failure.
405- }
406-
407- evmc_message msg{.kind = to_call_kind (Op)};
373+ evmc_message msg{.kind = EVMC_EOFCREATE};
408374 msg.gas = gas_left - gas_left / 64 ;
409375 if (input_size > 0 )
410376 {
@@ -436,8 +402,4 @@ template Result create_impl<OP_CREATE>(
436402 StackTop stack, int64_t gas_left, ExecutionState& state) noexcept ;
437403template Result create_impl<OP_CREATE2>(
438404 StackTop stack, int64_t gas_left, ExecutionState& state) noexcept ;
439- template Result create_eof_impl<OP_EOFCREATE>(
440- StackTop stack, int64_t gas_left, ExecutionState& state, code_iterator& pos) noexcept ;
441- template Result create_eof_impl<OP_TXCREATE>(
442- StackTop stack, int64_t gas_left, ExecutionState& state, code_iterator& pos) noexcept ;
443405} // namespace evmone::instr::core
0 commit comments