Skip to content

Commit

Permalink
Merge pull request #234 from eosnetworkfoundation/kayan_homestead
Browse files Browse the repository at this point in the history
[1.0] Allow higher s value in signature validation
  • Loading branch information
taokayan authored Jan 9, 2025
2 parents ed47133 + aa54a51 commit 7cc1d0b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion silkworm/core/protocol/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ 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()) {
if (!is_special_signature(txn.r, txn.s) && !is_valid_signature(txn.r, txn.s, rev >= EVMC_HOMESTEAD)) {
// 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)) {
return ValidationResult::kInvalidSignature;
}
}
Expand Down
6 changes: 5 additions & 1 deletion silkworm/node/stagedsync/stages/stage_senders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,11 @@ 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)};
const bool has_homestead{rev >= EVMC_HOMESTEAD};

// FIXME: enable has_homestead in some evm_version
//const bool has_homestead{rev >= EVMC_HOMESTEAD};
const bool has_homestead{false};

const bool has_spurious_dragon{rev >= EVMC_SPURIOUS_DRAGON};

uint32_t tx_id{0};
Expand Down

0 comments on commit 7cc1d0b

Please sign in to comment.