From 96544b4da7bb133acea1470942f9b65c83ebacf6 Mon Sep 17 00:00:00 2001 From: yarkin Date: Thu, 27 Jul 2023 11:15:26 +0800 Subject: [PATCH] Allow recover regular evm accounts as sender from s if r is 0. --- silkworm/core/types/transaction.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/silkworm/core/types/transaction.cpp b/silkworm/core/types/transaction.cpp index c0841bc4..64f4385e 100644 --- a/silkworm/core/types/transaction.cpp +++ b/silkworm/core/types/transaction.cpp @@ -422,7 +422,15 @@ void Transaction::recover_sender() { } if(r == intx::uint256()) { - from = make_reserved_address(static_cast(s)); + // s contains a regular evm_address if padded with '1's + // otherwise it's an eos name + if (s >> kAddressLength * 8 == (~intx::uint256(0)) >> kAddressLength * 8) { + from = evmc::address{}; + intx::be::trunc(from->bytes, s); + } + else { + from = make_reserved_address(static_cast(s)); + } return; }