Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpcdaemon: fix eth_call without sender #2019

Merged
merged 7 commits into from
May 14, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion silkworm/rpc/commands/eth_api_test.cpp
Original file line number Diff line number Diff line change
@@ -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);
}

3 changes: 0 additions & 3 deletions silkworm/rpc/core/evm_executor.cpp
Original file line number Diff line number Diff line change
@@ -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()};
3 changes: 3 additions & 0 deletions silkworm/rpc/types/call.hpp
Original file line number Diff line number Diff line change
@@ -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) {