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: print address on error in execution pre-checks #1886

Merged
merged 3 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/rpc-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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.3.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v0.4.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
cd ${{runner.workspace}}/rpc-tests
pip3 install -r requirements.txt

Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
cd ${{runner.workspace}}/rpc-tests/integration

# Run RPC integration test runner via http
python3 ./run_tests.py --continue --blockchain mainnet --jwt ${{runner.workspace}}/silkworm/build/cmd/jwt.hex --display-only-fail --port 8545 -x admin_,eth_mining,eth_getWork,eth_coinbase,eth_createAccessList/test_16.json,engine_ --transport_type both
python3 ./run_tests.py --continue --blockchain mainnet --jwt ${{runner.workspace}}/silkworm/build/cmd/jwt.hex --display-only-fail --port 8545 -x admin_,eth_mining,eth_getWork,eth_coinbase,eth_createAccessList/test_16.json,engine_ --transport_type http,websocket

# Capture test runner script exit status
test_exit_status=$?
Expand Down
3 changes: 2 additions & 1 deletion silkworm/rpc/core/evm_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ std::optional<std::string> EVMExecutor::pre_check(const EVM& evm, const silkworm
}
}
if (txn.gas_limit < g0) {
std::string error = "intrinsic gas too low: have " + std::to_string(txn.gas_limit) + ", want " + intx::to_string(g0);
std::string from = address_to_hex(*txn.sender());
std::string error = "intrinsic gas too low: address " + from + ", have " + std::to_string(txn.gas_limit) + ", want " + intx::to_string(g0);
return error;
}
return std::nullopt;
Expand Down
2 changes: 1 addition & 1 deletion silkworm/rpc/core/evm_executor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ TEST_CASE("EVMExecutor") {
my_pool.stop();
my_pool.join();
CHECK(result.error_code == std::nullopt);
CHECK(result.pre_check_error.value() == "intrinsic gas too low: have 0, want 53000");
CHECK(result.pre_check_error.value() == "intrinsic gas too low: address 0xa872626373628737383927236382161739290870, have 0, want 53000");
}

SECTION("failed if base_fee_per_gas > max_fee_per_gas ") {
Expand Down
4 changes: 2 additions & 2 deletions silkworm/rpc/core/evm_trace_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_call 1") {
const auto result = spawn_and_wait(executor.trace_call(block, call, config));

CHECK(result.pre_check_error.has_value() == true);
CHECK(result.pre_check_error.value() == "intrinsic gas too low: have 50000, want 53072");
CHECK(result.pre_check_error.value() == "intrinsic gas too low: address 0xe0a2bd4258d2768837baa26a28fe71dc079f84c7, have 50000, want 53072");
}

SECTION("Call: full output") {
Expand Down Expand Up @@ -1650,7 +1650,7 @@ TEST_CASE_METHOD(TraceCallExecutorTest, "TraceCallExecutor::trace_calls") {
const auto result = spawn_and_wait(executor.trace_calls(block, calls));

CHECK(result.pre_check_error.has_value() == true);
CHECK(result.pre_check_error.value() == "first run for txIndex 0 error: intrinsic gas too low: have 50000, want 53072");
CHECK(result.pre_check_error.value() == "first run for txIndex 0 error: intrinsic gas too low: address 0xe0a2bd4258d2768837baa26a28fe71dc079f84c7, have 50000, want 53072");
}

SECTION("Call: full output") {
Expand Down
Loading