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: compatibility flag in trace_get API #1983

Merged
merged 1 commit into from
Apr 27, 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
6 changes: 5 additions & 1 deletion silkworm/rpc/commands/trace_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <silkworm/core/common/util.hpp>
#include <silkworm/core/types/evmc_bytes32.hpp>
#include <silkworm/infra/common/log.hpp>
#include <silkworm/rpc/common/compatibility.hpp>
#include <silkworm/rpc/common/util.hpp>
#include <silkworm/rpc/core/blocks.hpp>
#include <silkworm/rpc/core/cached_chain.hpp>
Expand Down Expand Up @@ -435,7 +436,10 @@ Task<void> TraceRpcApi::handle_trace_get(const nlohmann::json& request, nlohmann
trace::TraceCallExecutor executor{*block_cache_, tx_database, *chain_storage, workers_, *tx};
const auto result = co_await executor.trace_transaction(*(tx_with_block->block_with_hash), tx_with_block->transaction);

uint16_t index = indices[0] + 1; // Erigon RpcDaemon compatibility
uint16_t index = indices[0];
if (rpc::compatibility::is_erigon_json_api_compatibility_required()) {
index = index + 1; // Erigon RpcDaemon compatibility
}
if (result.size() > index) {
reply = make_json_content(request, result[index]);
} else {
Expand Down
Loading