diff --git a/silkworm/core/protocol/validation.cpp b/silkworm/core/protocol/validation.cpp index ef435df6..e3b43bb7 100644 --- a/silkworm/core/protocol/validation.cpp +++ b/silkworm/core/protocol/validation.cpp @@ -66,11 +66,8 @@ ValidationResult pre_validate_transaction(const Transaction& txn, const evmc_rev /* Should the sender already be present it means the validation of signature already occurred */ if (!txn.from.has_value()) { - // FIXME: enable has_homestead in some evm_version - //const bool has_homestead{rev >= EVMC_HOMESTEAD}; - const bool has_homestead{false}; - - if (!is_special_signature(txn.r, txn.s) && !is_valid_signature(txn.r, txn.s, has_homestead)) { + const bool enforce_eip2{eos_evm_version >=3}; + if (!is_special_signature(txn.r, txn.s) && !is_valid_signature(txn.r, txn.s, enforce_eip2)) { return ValidationResult::kInvalidSignature; } } diff --git a/silkworm/node/stagedsync/stages/stage_senders.cpp b/silkworm/node/stagedsync/stages/stage_senders.cpp index 1f49809d..e7c0a4bd 100644 --- a/silkworm/node/stagedsync/stages/stage_senders.cpp +++ b/silkworm/node/stagedsync/stages/stage_senders.cpp @@ -29,6 +29,7 @@ #include #include #include +#include namespace silkworm::stagedsync { @@ -371,9 +372,7 @@ Stage::Result Senders::add_to_batch(const BlockHeader& header, BlockNum block_nu // We're only interested in revisions up to London, so it's OK to not detect time-based forks. const evmc_revision rev{node_settings_->chain_config->revision(header)}; - // FIXME: enable has_homestead in some evm_version - //const bool has_homestead{rev >= EVMC_HOMESTEAD}; - const bool has_homestead{false}; + const bool enforce_eip2{eosevm::nonce_to_version(header.nonce)>=3}; const bool has_spurious_dragon{rev >= EVMC_SPURIOUS_DRAGON}; @@ -385,7 +384,7 @@ Stage::Result Senders::add_to_batch(const BlockHeader& header, BlockNum block_nu return Stage::Result::kInvalidTransaction; } - if (!is_special_signature(transaction.r, transaction.s) && !is_valid_signature(transaction.r, transaction.s, has_homestead)) { + if (!is_special_signature(transaction.r, transaction.s) && !is_valid_signature(transaction.r, transaction.s, enforce_eip2)) { log::Error(log_prefix_) << "Got invalid signature for transaction #" << tx_id << " in block #" << block_num; return Stage::Result::kInvalidTransaction; }