@@ -16,8 +16,6 @@ namespace evmone::state
1616{
1717namespace
1818{
19- constexpr auto MAX_INITCODE_COUNT = 256 ;
20-
2119inline constexpr int64_t num_words (size_t size_in_bytes) noexcept
2220{
2321 return static_cast <int64_t >((size_in_bytes + 31 ) / 32 );
@@ -44,14 +42,6 @@ int64_t compute_access_list_cost(const AccessList& access_list) noexcept
4442 return cost;
4543}
4644
47- int64_t compute_initcode_list_cost (evmc_revision rev, std::span<const bytes> initcodes) noexcept
48- {
49- int64_t cost = 0 ;
50- for (const auto & initcode : initcodes)
51- cost += compute_tx_data_cost (rev, initcode);
52- return cost;
53- }
54-
5545int64_t compute_tx_intrinsic_cost (evmc_revision rev, const Transaction& tx) noexcept
5646{
5747 static constexpr auto call_tx_cost = 21000 ;
@@ -62,7 +52,7 @@ int64_t compute_tx_intrinsic_cost(evmc_revision rev, const Transaction& tx) noex
6252 is_create && rev >= EVMC_SHANGHAI ? initcode_word_cost * num_words (tx.data .size ()) : 0 ;
6353 const auto tx_cost = is_create && rev >= EVMC_HOMESTEAD ? create_tx_cost : call_tx_cost;
6454 return tx_cost + compute_tx_data_cost (rev, tx.data ) + compute_access_list_cost (tx.access_list ) +
65- compute_initcode_list_cost (rev, tx. initcodes ) + initcode_cost;
55+ initcode_cost;
6656}
6757
6858evmc_message build_message (
@@ -283,28 +273,12 @@ std::variant<int64_t, std::error_code> validate_transaction(const Account& sende
283273 return make_error_code (BLOB_GAS_LIMIT_EXCEEDED);
284274 break ;
285275
286- case Transaction::Type::initcodes:
287- if (rev < EVMC_OSAKA)
288- return make_error_code (TX_TYPE_NOT_SUPPORTED);
289- if (tx.initcodes .size () > MAX_INITCODE_COUNT)
290- return make_error_code (INIT_CODE_COUNT_LIMIT_EXCEEDED);
291- if (tx.initcodes .empty ())
292- return make_error_code (INIT_CODE_COUNT_ZERO);
293- if (std::any_of (tx.initcodes .begin (), tx.initcodes .end (),
294- [](const bytes& v) { return v.size () > MAX_INITCODE_SIZE; }))
295- return make_error_code (INIT_CODE_SIZE_LIMIT_EXCEEDED);
296- if (std::any_of (
297- tx.initcodes .begin (), tx.initcodes .end (), [](const bytes& v) { return v.empty (); }))
298- return make_error_code (INIT_CODE_EMPTY);
299- break ;
300-
301276 default :;
302277 }
303278
304279 switch (tx.type )
305280 {
306281 case Transaction::Type::blob:
307- case Transaction::Type::initcodes:
308282 case Transaction::Type::eip1559:
309283 if (rev < EVMC_LONDON)
310284 return make_error_code (TX_TYPE_NOT_SUPPORTED);
@@ -620,12 +594,6 @@ std::variant<TransactionReceipt, std::error_code> transition(State& state, const
620594 return " SenderNotEOA" ;
621595 case INIT_CODE_SIZE_LIMIT_EXCEEDED:
622596 return " TR_InitCodeLimitExceeded" ;
623- case INIT_CODE_EMPTY:
624- return " TR_InitCodeEmpty" ;
625- case INIT_CODE_COUNT_LIMIT_EXCEEDED:
626- return " TR_InitCodeCountLimitExceeded" ;
627- case INIT_CODE_COUNT_ZERO:
628- return " TR_InitCodeCountZero" ;
629597 case CREATE_BLOB_TX:
630598 return " TR_BLOBCREATE" ;
631599 case EMPTY_BLOB_HASHES_LIST:
0 commit comments