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 debug_storageRangeAt response for non-existent block hash #1948

Merged
merged 2 commits into from
Mar 29, 2024
Merged
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
7 changes: 4 additions & 3 deletions silkworm/rpc/commands/debug_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ Task<void> DebugRpcApi::handle_debug_storage_range_at(const nlohmann::json& requ

const auto block_with_hash = co_await core::read_block_by_hash(*block_cache_, *chain_storage, block_hash);
if (!block_with_hash) {
const std::string error_msg = "block not found ";
SILK_ERROR << "debug_storage_range_at: core::read_block_by_hash: " << error_msg << request.dump();
reply = make_json_error(request, -32000, error_msg);
SILK_WARN << "debug_storage_range_at: block not found, hash: " << evmc::hex(block_hash);
nlohmann::json result = {{"storage", nullptr}, {"nextKey", nullptr}};
reply = make_json_content(request, result);

co_await tx->close(); // RAII not (yet) available with coroutines
co_return;
}
Expand Down
Loading