Skip to content

Commit

Permalink
rpcdaemon: compatibility flag in trace_get API (#1983)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sixtysixter authored Apr 27, 2024
1 parent 230fcbf commit 1d86250
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 1d86250

Please sign in to comment.