From d813a9e5c8133d8f0d48fd7b1e2c6ef752cc0ccb Mon Sep 17 00:00:00 2001 From: lupin012 <58134934+lupin012@users.noreply.github.com> Date: Sat, 11 May 2024 00:06:51 +0200 Subject: [PATCH 1/5] if no sender is specified must be used 0x0000..000 --- silkworm/rpc/types/call.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/silkworm/rpc/types/call.hpp b/silkworm/rpc/types/call.hpp index 7708ac09e4..436e452d9a 100644 --- a/silkworm/rpc/types/call.hpp +++ b/silkworm/rpc/types/call.hpp @@ -51,6 +51,9 @@ struct Call { silkworm::Transaction txn{}; if (from) { txn.set_sender(*from); + } else { + constexpr auto zero_address = 0x0000000000000000000000000000000000000000_address; + txn.set_sender(zero_address); } txn.to = to; if (override_nonce) { From 7f5e976ba0b8ebf16195e43e44bd14eb121f955a Mon Sep 17 00:00:00 2001 From: lupin012 <58134934+lupin012@users.noreply.github.com> Date: Sat, 11 May 2024 00:15:43 +0200 Subject: [PATCH 2/5] if from is not provided use 0x000...00 --- silkworm/rpc/commands/eth_api_test.cpp | 2 +- silkworm/rpc/core/evm_executor.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/silkworm/rpc/commands/eth_api_test.cpp b/silkworm/rpc/commands/eth_api_test.cpp index 5582e9e5c7..5d39277bbe 100644 --- a/silkworm/rpc/commands/eth_api_test.cpp +++ b/silkworm/rpc/commands/eth_api_test.cpp @@ -96,7 +96,7 @@ TEST_CASE_METHOD(test::RpcApiE2ETest, "fuzzy: eth_call invalid params", "[rpc][a CHECK(nlohmann::json::parse(reply) == R"({ "jsonrpc":"2.0", "id":1, - "error":{"code":-32000,"message":"malformed transaction: cannot recover sender"} + "result":"0x" })"_json); } diff --git a/silkworm/rpc/core/evm_executor.cpp b/silkworm/rpc/core/evm_executor.cpp index fb361aa22f..94c8b758e8 100644 --- a/silkworm/rpc/core/evm_executor.cpp +++ b/silkworm/rpc/core/evm_executor.cpp @@ -238,9 +238,6 @@ ExecutionResult EVMExecutor::call( evm.add_tracer(*tracer); } - if (!txn.sender()) { - return {std::nullopt, txn.gas_limit, Bytes{}, "malformed transaction: cannot recover sender"}; - } ibs_state_.access_account(*txn.sender()); const evmc_revision rev{evm.revision()}; From 4d3a3dfedf3ef11c7adc2085a9c7a857dac2547a Mon Sep 17 00:00:00 2001 From: lupin012 <58134934+lupin012@users.noreply.github.com> Date: Sun, 12 May 2024 23:25:01 +0200 Subject: [PATCH 3/5] fix after review --- silkworm/rpc/types/call.hpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/silkworm/rpc/types/call.hpp b/silkworm/rpc/types/call.hpp index 436e452d9a..4fb6fb5096 100644 --- a/silkworm/rpc/types/call.hpp +++ b/silkworm/rpc/types/call.hpp @@ -49,12 +49,7 @@ struct Call { const std::optional& override_access_list = std::nullopt, const std::optional override_nonce = std::nullopt) const { silkworm::Transaction txn{}; - if (from) { - txn.set_sender(*from); - } else { - constexpr auto zero_address = 0x0000000000000000000000000000000000000000_address; - txn.set_sender(zero_address); - } + txn.set_sender(from ? *from : evmc::address{}); txn.to = to; if (override_nonce) { txn.nonce = *override_nonce; From 16e259c5bb3b3cf30721bf8a4e0fc4a2b5a92408 Mon Sep 17 00:00:00 2001 From: lupin012 <58134934+lupin012@users.noreply.github.com> Date: Sun, 12 May 2024 23:25:11 +0200 Subject: [PATCH 4/5] fix after review --- silkworm/rpc/core/evm_executor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/silkworm/rpc/core/evm_executor.cpp b/silkworm/rpc/core/evm_executor.cpp index 94c8b758e8..fb361aa22f 100644 --- a/silkworm/rpc/core/evm_executor.cpp +++ b/silkworm/rpc/core/evm_executor.cpp @@ -238,6 +238,9 @@ ExecutionResult EVMExecutor::call( evm.add_tracer(*tracer); } + if (!txn.sender()) { + return {std::nullopt, txn.gas_limit, Bytes{}, "malformed transaction: cannot recover sender"}; + } ibs_state_.access_account(*txn.sender()); const evmc_revision rev{evm.revision()}; From 98cb774f3dc34947bf9a0a26a4f20784130a5548 Mon Sep 17 00:00:00 2001 From: canepat <16927169+canepat@users.noreply.github.com> Date: Mon, 13 May 2024 10:15:24 +0200 Subject: [PATCH 5/5] Update rpc-integration-tests.yml --- .github/workflows/rpc-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rpc-integration-tests.yml b/.github/workflows/rpc-integration-tests.yml index f523ea1419..164b0257a6 100644 --- a/.github/workflows/rpc-integration-tests.yml +++ b/.github/workflows/rpc-integration-tests.yml @@ -27,7 +27,7 @@ jobs: - name: Checkout RPC Tests Repository & Install Requirements run: | rm -rf ${{runner.workspace}}/rpc-tests - git -c advice.detachedHead=false clone --depth 1 --branch v0.16.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests + git -c advice.detachedHead=false clone --depth 1 --branch v0.17.1 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests cd ${{runner.workspace}}/rpc-tests pip3 install -r requirements.txt