From 94b35e609f523efcb4ae57be32590ec7a3e6365a Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 31 Oct 2025 15:40:25 -0400 Subject: [PATCH 01/10] experimental: WASM debug logs stored in a db and outputted in `tx` --- include/xrpl/protocol/jss.h | 3 + src/xrpld/app/main/Application.cpp | 19 ++++- src/xrpld/app/main/Application.h | 4 + src/xrpld/app/main/DBInit.h | 14 ++++ src/xrpld/app/rdb/WasmDebug.h | 47 +++++++++++ src/xrpld/app/rdb/detail/WasmDebug.cpp | 94 ++++++++++++++++++++++ src/xrpld/app/tx/detail/Escrow.cpp | 8 ++ src/xrpld/app/wasm/HostFuncImpl.h | 7 ++ src/xrpld/app/wasm/detail/HostFuncImpl.cpp | 21 +++-- src/xrpld/rpc/handlers/Tx.cpp | 25 ++++++ 10 files changed, 234 insertions(+), 8 deletions(-) create mode 100644 src/xrpld/app/rdb/WasmDebug.h create mode 100644 src/xrpld/app/rdb/detail/WasmDebug.cpp diff --git a/include/xrpl/protocol/jss.h b/include/xrpl/protocol/jss.h index 7e62409da9d..ca196bb588a 100644 --- a/include/xrpl/protocol/jss.h +++ b/include/xrpl/protocol/jss.h @@ -259,6 +259,7 @@ JSS(engine_result); // out: NetworkOPs, TransactionSign, Submit JSS(engine_result_code); // out: NetworkOPs, TransactionSign, Submit JSS(engine_result_message); // out: NetworkOPs, TransactionSign, Submit JSS(entire_set); // out: get_aggregate_price +JSS(entry_id); // out: tx JSS(ephemeral_key); // out: ValidatorInfo // in/out: Manifest JSS(error); // out: error @@ -399,6 +400,7 @@ JSS(local); // out: resource/Logic.h JSS(local_txs); // out: GetCounts JSS(local_static_keys); // out: ValidatorList JSS(locked); // out: GatewayBalances +JSS(logs); // out: tx JSS(low); // out: BookChanges JSS(lowest_sequence); // out: AccountInfo JSS(lowest_ticket); // out: AccountInfo @@ -706,6 +708,7 @@ JSS(vote_slots); // out: amm_info JSS(vote_weight); // out: amm_info JSS(warning); // rpc: JSS(warnings); // out: server_info, server_state +JSS(wasm_debug_logs); // out: tx JSS(workers); JSS(write_load); // out: GetCounts // clang-format on diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 616afc957d4..909939bcc72 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -217,6 +218,7 @@ class ApplicationImp : public Application, public BasicApp std::unique_ptr mRelationalDatabase; std::unique_ptr mWalletDB; + std::unique_ptr mWasmDebugDB; std::unique_ptr overlay_; std::optional trapTxID_; @@ -828,6 +830,16 @@ class ApplicationImp : public Application, public BasicApp return *mWalletDB; } + DatabaseCon& + getWasmDebugDB() override + { + XRPL_ASSERT( + mWasmDebugDB, + "ripple::ApplicationImp::getWasmDebugDB : null wasm debug " + "database"); + return *mWasmDebugDB; + } + bool serverOkay(std::string& reason) override; @@ -843,17 +855,22 @@ class ApplicationImp : public Application, public BasicApp mWalletDB.get() == nullptr, "ripple::ApplicationImp::initRelationalDatabase : null wallet " "database"); + XRPL_ASSERT( + mWasmDebugDB.get() == nullptr, + "ripple::ApplicationImp::initRelationalDatabase : null wasm debug " + "database"); try { mRelationalDatabase = RelationalDatabase::init(*this, *config_, *m_jobQueue); - // wallet database auto setup = setup_DatabaseCon(*config_, m_journal); setup.useGlobalPragma = false; + // wallet database mWalletDB = makeWalletDB(setup, m_journal); + mWasmDebugDB = makeWasmDebugDB(setup, m_journal); } catch (std::exception const& e) { diff --git a/src/xrpld/app/main/Application.h b/src/xrpld/app/main/Application.h index b3a433fee8d..97063b593c8 100644 --- a/src/xrpld/app/main/Application.h +++ b/src/xrpld/app/main/Application.h @@ -268,6 +268,10 @@ class Application : public beast::PropertyStream::Source virtual DatabaseCon& getWalletDB() = 0; + /** Retrieve the "WASM debug database" */ + virtual DatabaseCon& + getWasmDebugDB() = 0; + /** Ensure that a newly-started validator does not sign proposals older * than the last ledger it persisted. */ virtual LedgerIndex diff --git a/src/xrpld/app/main/DBInit.h b/src/xrpld/app/main/DBInit.h index 192b1bedae3..0dd360c441e 100644 --- a/src/xrpld/app/main/DBInit.h +++ b/src/xrpld/app/main/DBInit.h @@ -135,6 +135,20 @@ inline constexpr std::array WalletDBInit{ "END TRANSACTION;"}}; +inline constexpr auto WasmDebugDBName{"wasm_debug.db"}; + +inline constexpr std::array WasmDebugDBInit{ + {"BEGIN TRANSACTION;", + + "CREATE TABLE IF NOT EXISTS WasmDebugLogs (" + " TransID CHARACTER(64) NOT NULL," + " ObjID CHARACTER(64) NOT NULL," + " Data TEXT NOT NULL," + " PRIMARY KEY(TransID, ObjID)" + ");", + + "END TRANSACTION;"}}; + } // namespace ripple #endif diff --git a/src/xrpld/app/rdb/WasmDebug.h b/src/xrpld/app/rdb/WasmDebug.h new file mode 100644 index 00000000000..da28fe37ba9 --- /dev/null +++ b/src/xrpld/app/rdb/WasmDebug.h @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2021 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef RIPPLE_APP_RDB_WASMDEBUG_H_INCLUDED +#define RIPPLE_APP_RDB_WASMDEBUG_H_INCLUDED + +#include +#include +#include +#include + +#include + +namespace ripple { + +std::unique_ptr +makeWasmDebugDB(DatabaseCon::Setup const& setup, beast::Journal j); + +void +addWasmDebugLogs( + soci::session& session, + TxID const& txId, + Keylet const& keylet, + std::vector const& data); + +std::map> +getWasmDebugByTxID(soci::session& session, TxID const& txId); + +} // namespace ripple + +#endif diff --git a/src/xrpld/app/rdb/detail/WasmDebug.cpp b/src/xrpld/app/rdb/detail/WasmDebug.cpp new file mode 100644 index 00000000000..ba89a48b427 --- /dev/null +++ b/src/xrpld/app/rdb/detail/WasmDebug.cpp @@ -0,0 +1,94 @@ +//------------------------------------------------------------------------------ +/* + This file is part of rippled: https://github.com/ripple/rippled + Copyright (c) 2021 Ripple Labs Inc. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#include + +#include + +namespace ripple { + +std::unique_ptr +makeWasmDebugDB(DatabaseCon::Setup const& setup, beast::Journal j) +{ + // WASM debug log database + return std::make_unique( + setup, + WasmDebugDBName, + std::array(), + WasmDebugDBInit, + j); +} + +void +addWasmDebugLogs( + soci::session& session, + TxID const& txId, + Keylet const& keylet, + std::vector const& data) +{ + soci::transaction tr(session); + + // Convert all the info to appropriate formats + std::string const txHex = to_string(txId); + std::string const keyletHex = to_string(keylet.key); + std::string const logString = boost::algorithm::join(data, ","); + + // replace = because you run transactions twice: open _and_ closed ledger + session << "INSERT OR REPLACE INTO WasmDebugLogs " + "(TransID, ObjID, Data) VALUES " + "(:transID, :objId, :data)", + soci::use(txHex), soci::use(keyletHex), soci::use(logString); + + tr.commit(); +} + +std::map> +getWasmDebugByTxID(soci::session& session, TxID const& txId) +{ + std::map> ret; + + std::string const txHex = to_string(txId); + + std::string objHex; + std::string logString; + + soci::statement st = + (session.prepare << "SELECT ObjID, Data FROM WasmDebugLogs " + "WHERE TransID = :txId", + soci::use(txHex), + soci::into(objHex), + soci::into(logString)); + + st.execute(); + + while (st.fetch()) + { + uint256 objId; + if (objId.parseHex(objHex)) + { + std::vector logs; + boost::algorithm::split(logs, logString, boost::is_any_of(",")); + ret.emplace(objId, logs); + } + } + + return ret; +} + +} // namespace ripple diff --git a/src/xrpld/app/tx/detail/Escrow.cpp b/src/xrpld/app/tx/detail/Escrow.cpp index 9a4b6383993..e0e457e2e14 100644 --- a/src/xrpld/app/tx/detail/Escrow.cpp +++ b/src/xrpld/app/tx/detail/Escrow.cpp @@ -18,6 +18,7 @@ //============================================================================== #include +#include #include #include #include @@ -37,6 +38,7 @@ #include #include + namespace ripple { // During an EscrowFinish, the transaction must specify both @@ -1335,6 +1337,12 @@ EscrowFinish::doApply() auto re = runEscrowWasm( wasm, ESCROW_FUNCTION_NAME, {}, &ledgerDataProvider, allowance); JLOG(j_.trace()) << "Escrow WASM ran"; + auto const& logs = ledgerDataProvider.getLogs(); + if (!logs.empty()) + { + auto db = ctx_.app.getWasmDebugDB().checkoutDb(); + addWasmDebugLogs(*db, ctx_.tx.getTransactionID(), k, logs); + } if (auto const& data = ledgerDataProvider.getData(); data.has_value()) { diff --git a/src/xrpld/app/wasm/HostFuncImpl.h b/src/xrpld/app/wasm/HostFuncImpl.h index f56aa102a5a..cc3754f103a 100644 --- a/src/xrpld/app/wasm/HostFuncImpl.h +++ b/src/xrpld/app/wasm/HostFuncImpl.h @@ -29,6 +29,7 @@ class WasmHostFunctionsImpl : public HostFunctions Keylet leKey; std::shared_ptr currentLedgerObj = nullptr; bool isLedgerObjCached = false; + std::vector logs_; static int constexpr MAX_CACHE = 256; std::array, MAX_CACHE> cache; @@ -90,6 +91,12 @@ class WasmHostFunctionsImpl : public HostFunctions return data_; } + std::vector const& + getLogs() const + { + return logs_; + } + Expected getLedgerSqn() override; diff --git a/src/xrpld/app/wasm/detail/HostFuncImpl.cpp b/src/xrpld/app/wasm/detail/HostFuncImpl.cpp index b21a3d8b620..883a48e6318 100644 --- a/src/xrpld/app/wasm/detail/HostFuncImpl.cpp +++ b/src/xrpld/app/wasm/detail/HostFuncImpl.cpp @@ -742,9 +742,12 @@ WasmHostFunctionsImpl::trace( #endif if (!asHex) { - j << "WAMR TRACE (" << leKey.key << "): " << msg << " " + auto const dataStr = std::string_view( + reinterpret_cast(data.data()), data.size()); + j << "WasmTrace(" << leKey.key << "): " << msg << " " << std::string_view( reinterpret_cast(data.data()), data.size()); + logs_.emplace_back(std::string(msg) + " " + std::string(dataStr)); } else { @@ -752,7 +755,8 @@ WasmHostFunctionsImpl::trace( hex.reserve(data.size() * 2); boost::algorithm::hex( data.begin(), data.end(), std::back_inserter(hex)); - j << "WAMR DEV TRACE (" << leKey.key << "): " << msg << " " << hex; + j << "WasmTrace(" << leKey.key << "): " << msg << " " << hex; + logs_.emplace_back(std::string(msg) + " " + hex); } return msg.size() + data.size() * (asHex ? 2 : 1); @@ -766,7 +770,8 @@ WasmHostFunctionsImpl::traceNum(std::string_view const& msg, int64_t data) #else auto j = getJournal().trace(); #endif - j << "WAMR TRACE NUM(" << leKey.key << "): " << msg << " " << data; + j << "WasmTrace(" << leKey.key << "): " << msg << " " << data; + logs_.emplace_back(std::string(msg) + " " + std::to_string(data)); return msg.size() + sizeof(data); } @@ -783,8 +788,8 @@ WasmHostFunctionsImpl::traceAccount( auto const accountStr = toBase58(account); - j << "WAMR TRACE ACCOUNT(" << leKey.key << "): " << msg << " " - << accountStr; + j << "WasmTrace(" << leKey.key << "): " << msg << " " << accountStr; + logs_.emplace_back(std::string(msg) + " " + accountStr); return msg.size() + accountStr.size(); } @@ -799,7 +804,8 @@ WasmHostFunctionsImpl::traceFloat( auto j = getJournal().trace(); #endif auto const s = floatToString(data); - j << "WAMR TRACE FLOAT(" << leKey.key << "): " << msg << " " << s; + j << "WasmTrace(" << leKey.key << "): " << msg << " " << s; + logs_.emplace_back(std::string(msg) + " " + s); return msg.size() + s.size(); } @@ -814,7 +820,8 @@ WasmHostFunctionsImpl::traceAmount( auto j = getJournal().trace(); #endif auto const amountStr = amount.getFullText(); - j << "WAMR TRACE AMOUNT(" << leKey.key << "): " << msg << " " << amountStr; + j << "WasmTrace(" << leKey.key << "): " << msg << " " << amountStr; + logs_.emplace_back(std::string(msg) + " " + amountStr); return msg.size() + amountStr.size(); } diff --git a/src/xrpld/rpc/handlers/Tx.cpp b/src/xrpld/rpc/handlers/Tx.cpp index d43a699ab31..2e86efb45ff 100644 --- a/src/xrpld/rpc/handlers/Tx.cpp +++ b/src/xrpld/rpc/handlers/Tx.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,7 @@ struct TxResult std::optional closeTime; std::optional ledgerHash; TxSearched searchedAll; + std::map> wasmDebugLogs; }; struct TxArgs @@ -182,6 +184,13 @@ doTxHelp(RPC::Context& context, TxArgs args) } } + if (txn->getSTransaction()->isFieldPresent(sfComputationAllowance)) + { + auto db = context.app.getWasmDebugDB().checkoutDb(); + auto const logs = getWasmDebugByTxID(*db, txn->getID()); + result.wasmDebugLogs = logs; + } + return {result, rpcSUCCESS}; } @@ -278,6 +287,22 @@ populateJsonResponse( if (result.ctid) response[jss::ctid] = *(result.ctid); + + if (!result.wasmDebugLogs.empty()) + { + response[jss::wasm_debug_logs] = Json::Value(Json::arrayValue); + for (auto const& [entryId, logs] : result.wasmDebugLogs) + { + Json::Value logEntry = Json::objectValue; + logEntry[jss::entry_id] = to_string(entryId); + logEntry[jss::logs] = Json::arrayValue; + for (auto& log : logs) + { + logEntry[jss::logs].append(log); + } + response[jss::wasm_debug_logs].append(logEntry); + } + } } return response; } From 434cc900dfdc3142c75fbc43b3602cc424aef204 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 31 Oct 2025 15:48:04 -0400 Subject: [PATCH 02/10] disable if useTxTables is disabled --- src/xrpld/app/main/Application.cpp | 6 +++++- src/xrpld/app/tx/detail/Escrow.cpp | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 909939bcc72..3eb70bbb20c 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -870,7 +870,11 @@ class ApplicationImp : public Application, public BasicApp // wallet database mWalletDB = makeWalletDB(setup, m_journal); - mWasmDebugDB = makeWasmDebugDB(setup, m_journal); + if (config->useTxTables()) + { + // wasm debug database + mWasmDebugDB = makeWasmDebugDB(setup, m_journal); + } } catch (std::exception const& e) { diff --git a/src/xrpld/app/tx/detail/Escrow.cpp b/src/xrpld/app/tx/detail/Escrow.cpp index e0e457e2e14..2a5c1420fe8 100644 --- a/src/xrpld/app/tx/detail/Escrow.cpp +++ b/src/xrpld/app/tx/detail/Escrow.cpp @@ -1337,8 +1337,8 @@ EscrowFinish::doApply() auto re = runEscrowWasm( wasm, ESCROW_FUNCTION_NAME, {}, &ledgerDataProvider, allowance); JLOG(j_.trace()) << "Escrow WASM ran"; - auto const& logs = ledgerDataProvider.getLogs(); - if (!logs.empty()) + if (ctx_.app.config().useTxTables() && + (auto const& logs = ledgerDataProvider.getLogs(); !logs.empty())) { auto db = ctx_.app.getWasmDebugDB().checkoutDb(); addWasmDebugLogs(*db, ctx_.tx.getTransactionID(), k, logs); From f9ee4a3e1cb51586002479c979b1abe11fb9d847 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 31 Oct 2025 16:28:04 -0400 Subject: [PATCH 03/10] fix issues, change write to be async --- src/xrpld/app/main/Application.cpp | 2 +- src/xrpld/app/rdb/detail/WasmDebug.cpp | 2 +- src/xrpld/app/tx/detail/Escrow.cpp | 31 ++++++++++++++++++++++---- src/xrpld/core/Job.h | 1 + src/xrpld/core/JobTypes.h | 1 + 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 3eb70bbb20c..2f49ab536cd 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -870,7 +870,7 @@ class ApplicationImp : public Application, public BasicApp // wallet database mWalletDB = makeWalletDB(setup, m_journal); - if (config->useTxTables()) + if (config().useTxTables()) { // wasm debug database mWasmDebugDB = makeWasmDebugDB(setup, m_journal); diff --git a/src/xrpld/app/rdb/detail/WasmDebug.cpp b/src/xrpld/app/rdb/detail/WasmDebug.cpp index ba89a48b427..b2b608471b1 100644 --- a/src/xrpld/app/rdb/detail/WasmDebug.cpp +++ b/src/xrpld/app/rdb/detail/WasmDebug.cpp @@ -19,7 +19,7 @@ #include -#include +#include namespace ripple { diff --git a/src/xrpld/app/tx/detail/Escrow.cpp b/src/xrpld/app/tx/detail/Escrow.cpp index 2a5c1420fe8..390934ab18f 100644 --- a/src/xrpld/app/tx/detail/Escrow.cpp +++ b/src/xrpld/app/tx/detail/Escrow.cpp @@ -1337,11 +1337,34 @@ EscrowFinish::doApply() auto re = runEscrowWasm( wasm, ESCROW_FUNCTION_NAME, {}, &ledgerDataProvider, allowance); JLOG(j_.trace()) << "Escrow WASM ran"; - if (ctx_.app.config().useTxTables() && - (auto const& logs = ledgerDataProvider.getLogs(); !logs.empty())) + auto const& logs = ledgerDataProvider.getLogs(); + if (ctx_.app.config().useTxTables() && !logs.empty()) { - auto db = ctx_.app.getWasmDebugDB().checkoutDb(); - addWasmDebugLogs(*db, ctx_.tx.getTransactionID(), k, logs); + // Capture by value to avoid lifetime issues + auto txId = ctx_.tx.getTransactionID(); + auto keylet = k; + auto logsCopy = logs; + + ctx_.app.getJobQueue().addJob( + jtWRITE_WASM_DEBUG, + "writeWasmDebug", + [&app = ctx_.app, + txId, + keylet, + logsCopy = std::move(logsCopy)]() { + try + { + auto db = app.getWasmDebugDB().checkoutDb(); + addWasmDebugLogs(*db, txId, keylet, logsCopy); + } + catch (std::exception const& e) + { + // Log error but don't crash - debug logs are + // non-critical + JLOG(app.journal("WasmDebug").warn()) + << "Failed to write WASM debug logs: " << e.what(); + } + }); } if (auto const& data = ledgerDataProvider.getData(); data.has_value()) diff --git a/src/xrpld/core/Job.h b/src/xrpld/core/Job.h index 11b0b9b72b3..5c29daf5a7d 100644 --- a/src/xrpld/core/Job.h +++ b/src/xrpld/core/Job.h @@ -75,6 +75,7 @@ enum JobType { jtNETOP_CLUSTER, // NetworkOPs cluster peer report jtNETOP_TIMER, // NetworkOPs net timer processing jtADMIN, // An administrative operation + jtWRITE_WASM_DEBUG, // Write WASM debug logs // Special job types which are not dispatched by the job pool jtPEER, diff --git a/src/xrpld/core/JobTypes.h b/src/xrpld/core/JobTypes.h index 29863893d97..2bb69e2a644 100644 --- a/src/xrpld/core/JobTypes.h +++ b/src/xrpld/core/JobTypes.h @@ -108,6 +108,7 @@ class JobTypes add(jtADMIN, "administration", maxLimit, 0ms, 0ms); add(jtMISSING_TXN, "handleHaveTransactions", 1200, 0ms, 0ms); add(jtREQUESTED_TXN, "doTransactions", 1200, 0ms, 0ms); + add(jtWRITE_WASM_DEBUG, "writeWasmDebug", maxLimit, 0ms, 0ms); add(jtPEER, "peerCommand", 0, 200ms, 2500ms); add(jtDISK, "diskAccess", 0, 500ms, 1000ms); From b95c3265a94d3334d86733beb386a7a2857b9cc3 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 31 Oct 2025 16:36:37 -0400 Subject: [PATCH 04/10] fix some issues --- src/xrpld/app/rdb/detail/WasmDebug.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xrpld/app/rdb/detail/WasmDebug.cpp b/src/xrpld/app/rdb/detail/WasmDebug.cpp index b2b608471b1..e626b897a81 100644 --- a/src/xrpld/app/rdb/detail/WasmDebug.cpp +++ b/src/xrpld/app/rdb/detail/WasmDebug.cpp @@ -42,12 +42,13 @@ addWasmDebugLogs( Keylet const& keylet, std::vector const& data) { + XRPL_ASSERT(session.is_open(), "ripple::addWasmDebugLogs : open session"); soci::transaction tr(session); // Convert all the info to appropriate formats std::string const txHex = to_string(txId); std::string const keyletHex = to_string(keylet.key); - std::string const logString = boost::algorithm::join(data, ","); + std::string const logString = boost::algorithm::join(data, "\x1F"); // replace = because you run transactions twice: open _and_ closed ledger session << "INSERT OR REPLACE INTO WasmDebugLogs " @@ -61,6 +62,7 @@ addWasmDebugLogs( std::map> getWasmDebugByTxID(soci::session& session, TxID const& txId) { + XRPL_ASSERT(session.is_open(), "ripple::addWasmDebugLogs : open session"); std::map> ret; std::string const txHex = to_string(txId); @@ -83,7 +85,7 @@ getWasmDebugByTxID(soci::session& session, TxID const& txId) if (objId.parseHex(objHex)) { std::vector logs; - boost::algorithm::split(logs, logString, boost::is_any_of(",")); + boost::algorithm::split(logs, logString, boost::is_any_of("\x1F")); ret.emplace(objId, logs); } } From e3e376fa2cba8570961d589c41830ed7d147e3ab Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 31 Oct 2025 16:41:58 -0400 Subject: [PATCH 05/10] fix issues --- src/xrpld/app/rdb/detail/WasmDebug.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/xrpld/app/rdb/detail/WasmDebug.cpp b/src/xrpld/app/rdb/detail/WasmDebug.cpp index e626b897a81..3a6df2cedf2 100644 --- a/src/xrpld/app/rdb/detail/WasmDebug.cpp +++ b/src/xrpld/app/rdb/detail/WasmDebug.cpp @@ -42,7 +42,6 @@ addWasmDebugLogs( Keylet const& keylet, std::vector const& data) { - XRPL_ASSERT(session.is_open(), "ripple::addWasmDebugLogs : open session"); soci::transaction tr(session); // Convert all the info to appropriate formats @@ -62,7 +61,6 @@ addWasmDebugLogs( std::map> getWasmDebugByTxID(soci::session& session, TxID const& txId) { - XRPL_ASSERT(session.is_open(), "ripple::addWasmDebugLogs : open session"); std::map> ret; std::string const txHex = to_string(txId); From 6a289b91ad64351253f58fd8c50b64f913efbc01 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 31 Oct 2025 16:51:49 -0400 Subject: [PATCH 06/10] do some renames --- include/xrpl/protocol/jss.h | 4 ++-- src/xrpld/app/main/Application.cpp | 16 +++++++------- src/xrpld/app/main/Application.h | 2 +- src/xrpld/app/main/DBInit.h | 6 ++--- .../app/rdb/{WasmDebug.h => WasmTrace.h} | 10 ++++----- .../detail/{WasmDebug.cpp => WasmTrace.cpp} | 16 +++++++------- src/xrpld/app/tx/detail/Escrow.cpp | 12 +++++----- src/xrpld/core/Job.h | 2 +- src/xrpld/core/JobTypes.h | 2 +- src/xrpld/rpc/handlers/Tx.cpp | 22 +++++++++---------- 10 files changed, 46 insertions(+), 46 deletions(-) rename src/xrpld/app/rdb/{WasmDebug.h => WasmTrace.h} (86%) rename src/xrpld/app/rdb/detail/{WasmDebug.cpp => WasmTrace.cpp} (88%) diff --git a/include/xrpl/protocol/jss.h b/include/xrpl/protocol/jss.h index ca196bb588a..1f7624de179 100644 --- a/include/xrpl/protocol/jss.h +++ b/include/xrpl/protocol/jss.h @@ -400,7 +400,6 @@ JSS(local); // out: resource/Logic.h JSS(local_txs); // out: GetCounts JSS(local_static_keys); // out: ValidatorList JSS(locked); // out: GatewayBalances -JSS(logs); // out: tx JSS(low); // out: BookChanges JSS(lowest_sequence); // out: AccountInfo JSS(lowest_ticket); // out: AccountInfo @@ -624,6 +623,7 @@ JSS(total); // out: counters JSS(total_bytes_recv); // out: Peers JSS(total_bytes_sent); // out: Peers JSS(total_coins); // out: LedgerToJson +JSS(traces); // out: tx JSS(trading_fee); // out: amm_info JSS(transTreeHash); // out: ledger/Ledger.cpp JSS(transaction); // in: Tx @@ -708,7 +708,7 @@ JSS(vote_slots); // out: amm_info JSS(vote_weight); // out: amm_info JSS(warning); // rpc: JSS(warnings); // out: server_info, server_state -JSS(wasm_debug_logs); // out: tx +JSS(wasm_traces); // out: tx JSS(workers); JSS(write_load); // out: GetCounts // clang-format on diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 2f49ab536cd..8137eb6af89 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include @@ -218,7 +218,7 @@ class ApplicationImp : public Application, public BasicApp std::unique_ptr mRelationalDatabase; std::unique_ptr mWalletDB; - std::unique_ptr mWasmDebugDB; + std::unique_ptr mWasmTraceDB; std::unique_ptr overlay_; std::optional trapTxID_; @@ -831,13 +831,13 @@ class ApplicationImp : public Application, public BasicApp } DatabaseCon& - getWasmDebugDB() override + getWasmTraceDB() override { XRPL_ASSERT( - mWasmDebugDB, - "ripple::ApplicationImp::getWasmDebugDB : null wasm debug " + mWasmTraceDB, + "ripple::ApplicationImp::getWasmTraceDB : null wasm debug " "database"); - return *mWasmDebugDB; + return *mWasmTraceDB; } bool @@ -856,7 +856,7 @@ class ApplicationImp : public Application, public BasicApp "ripple::ApplicationImp::initRelationalDatabase : null wallet " "database"); XRPL_ASSERT( - mWasmDebugDB.get() == nullptr, + mWasmTraceDB.get() == nullptr, "ripple::ApplicationImp::initRelationalDatabase : null wasm debug " "database"); @@ -873,7 +873,7 @@ class ApplicationImp : public Application, public BasicApp if (config().useTxTables()) { // wasm debug database - mWasmDebugDB = makeWasmDebugDB(setup, m_journal); + mWasmTraceDB = makeWasmTraceDB(setup, m_journal); } } catch (std::exception const& e) diff --git a/src/xrpld/app/main/Application.h b/src/xrpld/app/main/Application.h index 97063b593c8..c6778b8cffb 100644 --- a/src/xrpld/app/main/Application.h +++ b/src/xrpld/app/main/Application.h @@ -270,7 +270,7 @@ class Application : public beast::PropertyStream::Source /** Retrieve the "WASM debug database" */ virtual DatabaseCon& - getWasmDebugDB() = 0; + getWasmTraceDB() = 0; /** Ensure that a newly-started validator does not sign proposals older * than the last ledger it persisted. */ diff --git a/src/xrpld/app/main/DBInit.h b/src/xrpld/app/main/DBInit.h index 0dd360c441e..3f0d1015b28 100644 --- a/src/xrpld/app/main/DBInit.h +++ b/src/xrpld/app/main/DBInit.h @@ -135,12 +135,12 @@ inline constexpr std::array WalletDBInit{ "END TRANSACTION;"}}; -inline constexpr auto WasmDebugDBName{"wasm_debug.db"}; +inline constexpr auto WasmTraceDBName{"wasm_trace.db"}; -inline constexpr std::array WasmDebugDBInit{ +inline constexpr std::array WasmTraceDBInit{ {"BEGIN TRANSACTION;", - "CREATE TABLE IF NOT EXISTS WasmDebugLogs (" + "CREATE TABLE IF NOT EXISTS WasmTraceLogs (" " TransID CHARACTER(64) NOT NULL," " ObjID CHARACTER(64) NOT NULL," " Data TEXT NOT NULL," diff --git a/src/xrpld/app/rdb/WasmDebug.h b/src/xrpld/app/rdb/WasmTrace.h similarity index 86% rename from src/xrpld/app/rdb/WasmDebug.h rename to src/xrpld/app/rdb/WasmTrace.h index da28fe37ba9..c71e6167f43 100644 --- a/src/xrpld/app/rdb/WasmDebug.h +++ b/src/xrpld/app/rdb/WasmTrace.h @@ -17,8 +17,8 @@ */ //============================================================================== -#ifndef RIPPLE_APP_RDB_WASMDEBUG_H_INCLUDED -#define RIPPLE_APP_RDB_WASMDEBUG_H_INCLUDED +#ifndef RIPPLE_APP_RDB_WasmTrace_H_INCLUDED +#define RIPPLE_APP_RDB_WasmTrace_H_INCLUDED #include #include @@ -30,17 +30,17 @@ namespace ripple { std::unique_ptr -makeWasmDebugDB(DatabaseCon::Setup const& setup, beast::Journal j); +makeWasmTraceDB(DatabaseCon::Setup const& setup, beast::Journal j); void -addWasmDebugLogs( +addWasmTraceLogs( soci::session& session, TxID const& txId, Keylet const& keylet, std::vector const& data); std::map> -getWasmDebugByTxID(soci::session& session, TxID const& txId); +getWasmTraceByTxID(soci::session& session, TxID const& txId); } // namespace ripple diff --git a/src/xrpld/app/rdb/detail/WasmDebug.cpp b/src/xrpld/app/rdb/detail/WasmTrace.cpp similarity index 88% rename from src/xrpld/app/rdb/detail/WasmDebug.cpp rename to src/xrpld/app/rdb/detail/WasmTrace.cpp index 3a6df2cedf2..17148564ee8 100644 --- a/src/xrpld/app/rdb/detail/WasmDebug.cpp +++ b/src/xrpld/app/rdb/detail/WasmTrace.cpp @@ -17,26 +17,26 @@ */ //============================================================================== -#include +#include #include namespace ripple { std::unique_ptr -makeWasmDebugDB(DatabaseCon::Setup const& setup, beast::Journal j) +makeWasmTraceDB(DatabaseCon::Setup const& setup, beast::Journal j) { // WASM debug log database return std::make_unique( setup, - WasmDebugDBName, + WasmTraceDBName, std::array(), - WasmDebugDBInit, + WasmTraceDBInit, j); } void -addWasmDebugLogs( +addWasmTraceLogs( soci::session& session, TxID const& txId, Keylet const& keylet, @@ -50,7 +50,7 @@ addWasmDebugLogs( std::string const logString = boost::algorithm::join(data, "\x1F"); // replace = because you run transactions twice: open _and_ closed ledger - session << "INSERT OR REPLACE INTO WasmDebugLogs " + session << "INSERT OR REPLACE INTO WasmTraceLogs " "(TransID, ObjID, Data) VALUES " "(:transID, :objId, :data)", soci::use(txHex), soci::use(keyletHex), soci::use(logString); @@ -59,7 +59,7 @@ addWasmDebugLogs( } std::map> -getWasmDebugByTxID(soci::session& session, TxID const& txId) +getWasmTraceByTxID(soci::session& session, TxID const& txId) { std::map> ret; @@ -69,7 +69,7 @@ getWasmDebugByTxID(soci::session& session, TxID const& txId) std::string logString; soci::statement st = - (session.prepare << "SELECT ObjID, Data FROM WasmDebugLogs " + (session.prepare << "SELECT ObjID, Data FROM WasmTraceLogs " "WHERE TransID = :txId", soci::use(txHex), soci::into(objHex), diff --git a/src/xrpld/app/tx/detail/Escrow.cpp b/src/xrpld/app/tx/detail/Escrow.cpp index 390934ab18f..12f048ecf46 100644 --- a/src/xrpld/app/tx/detail/Escrow.cpp +++ b/src/xrpld/app/tx/detail/Escrow.cpp @@ -18,7 +18,7 @@ //============================================================================== #include -#include +#include #include #include #include @@ -1346,22 +1346,22 @@ EscrowFinish::doApply() auto logsCopy = logs; ctx_.app.getJobQueue().addJob( - jtWRITE_WASM_DEBUG, - "writeWasmDebug", + jtWRITE_RPC_DEBUG, + "writeWasmTrace", [&app = ctx_.app, txId, keylet, logsCopy = std::move(logsCopy)]() { try { - auto db = app.getWasmDebugDB().checkoutDb(); - addWasmDebugLogs(*db, txId, keylet, logsCopy); + auto db = app.getWasmTraceDB().checkoutDb(); + addWasmTraceLogs(*db, txId, keylet, logsCopy); } catch (std::exception const& e) { // Log error but don't crash - debug logs are // non-critical - JLOG(app.journal("WasmDebug").warn()) + JLOG(app.journal("WasmTrace").warn()) << "Failed to write WASM debug logs: " << e.what(); } }); diff --git a/src/xrpld/core/Job.h b/src/xrpld/core/Job.h index 5c29daf5a7d..44aad00c638 100644 --- a/src/xrpld/core/Job.h +++ b/src/xrpld/core/Job.h @@ -75,7 +75,7 @@ enum JobType { jtNETOP_CLUSTER, // NetworkOPs cluster peer report jtNETOP_TIMER, // NetworkOPs net timer processing jtADMIN, // An administrative operation - jtWRITE_WASM_DEBUG, // Write WASM debug logs + jtWRITE_RPC_DEBUG, // Write RPC debug logs to dbs // Special job types which are not dispatched by the job pool jtPEER, diff --git a/src/xrpld/core/JobTypes.h b/src/xrpld/core/JobTypes.h index 2bb69e2a644..a4d441cf7e8 100644 --- a/src/xrpld/core/JobTypes.h +++ b/src/xrpld/core/JobTypes.h @@ -108,7 +108,7 @@ class JobTypes add(jtADMIN, "administration", maxLimit, 0ms, 0ms); add(jtMISSING_TXN, "handleHaveTransactions", 1200, 0ms, 0ms); add(jtREQUESTED_TXN, "doTransactions", 1200, 0ms, 0ms); - add(jtWRITE_WASM_DEBUG, "writeWasmDebug", maxLimit, 0ms, 0ms); + add(jtWRITE_RPC_DEBUG, "writeRPCDebug", maxLimit, 0ms, 0ms); add(jtPEER, "peerCommand", 0, 200ms, 2500ms); add(jtDISK, "diskAccess", 0, 500ms, 1000ms); diff --git a/src/xrpld/rpc/handlers/Tx.cpp b/src/xrpld/rpc/handlers/Tx.cpp index 2e86efb45ff..3f3c329b47e 100644 --- a/src/xrpld/rpc/handlers/Tx.cpp +++ b/src/xrpld/rpc/handlers/Tx.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -62,7 +62,7 @@ struct TxResult std::optional closeTime; std::optional ledgerHash; TxSearched searchedAll; - std::map> wasmDebugLogs; + std::map> WasmTraceLogs; }; struct TxArgs @@ -186,9 +186,9 @@ doTxHelp(RPC::Context& context, TxArgs args) if (txn->getSTransaction()->isFieldPresent(sfComputationAllowance)) { - auto db = context.app.getWasmDebugDB().checkoutDb(); - auto const logs = getWasmDebugByTxID(*db, txn->getID()); - result.wasmDebugLogs = logs; + auto db = context.app.getWasmTraceDB().checkoutDb(); + auto const logs = getWasmTraceByTxID(*db, txn->getID()); + result.WasmTraceLogs = logs; } return {result, rpcSUCCESS}; @@ -288,19 +288,19 @@ populateJsonResponse( if (result.ctid) response[jss::ctid] = *(result.ctid); - if (!result.wasmDebugLogs.empty()) + if (!result.WasmTraceLogs.empty()) { - response[jss::wasm_debug_logs] = Json::Value(Json::arrayValue); - for (auto const& [entryId, logs] : result.wasmDebugLogs) + response[jss::wasm_traces] = Json::Value(Json::arrayValue); + for (auto const& [entryId, logs] : result.WasmTraceLogs) { Json::Value logEntry = Json::objectValue; logEntry[jss::entry_id] = to_string(entryId); - logEntry[jss::logs] = Json::arrayValue; + logEntry[jss::traces] = Json::arrayValue; for (auto& log : logs) { - logEntry[jss::logs].append(log); + logEntry[jss::traces].append(log); } - response[jss::wasm_debug_logs].append(logEntry); + response[jss::wasm_traces].append(logEntry); } } } From d9e30c7201968b9499361f55f1a3b4d24dfcc8f4 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 20 Nov 2025 23:54:00 +0530 Subject: [PATCH 07/10] fix copyright stuff --- src/xrpld/app/rdb/WasmTrace.h | 19 ------------------- src/xrpld/app/rdb/detail/WasmTrace.cpp | 19 ------------------- 2 files changed, 38 deletions(-) diff --git a/src/xrpld/app/rdb/WasmTrace.h b/src/xrpld/app/rdb/WasmTrace.h index c71e6167f43..5f44e826af0 100644 --- a/src/xrpld/app/rdb/WasmTrace.h +++ b/src/xrpld/app/rdb/WasmTrace.h @@ -1,22 +1,3 @@ -//------------------------------------------------------------------------------ -/* - This file is part of rippled: https://github.com/ripple/rippled - Copyright (c) 2021 Ripple Labs Inc. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - #ifndef RIPPLE_APP_RDB_WasmTrace_H_INCLUDED #define RIPPLE_APP_RDB_WasmTrace_H_INCLUDED diff --git a/src/xrpld/app/rdb/detail/WasmTrace.cpp b/src/xrpld/app/rdb/detail/WasmTrace.cpp index 17148564ee8..6f12fa9765a 100644 --- a/src/xrpld/app/rdb/detail/WasmTrace.cpp +++ b/src/xrpld/app/rdb/detail/WasmTrace.cpp @@ -1,22 +1,3 @@ -//------------------------------------------------------------------------------ -/* - This file is part of rippled: https://github.com/ripple/rippled - Copyright (c) 2021 Ripple Labs Inc. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - #include #include From 60311d0d1fc7c558d665e7de4e9728b7e2e8298a Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 21 Nov 2025 00:21:41 +0530 Subject: [PATCH 08/10] more rename fixes --- src/xrpld/app/rdb/WasmTrace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xrpld/app/rdb/WasmTrace.h b/src/xrpld/app/rdb/WasmTrace.h index 5f44e826af0..2cfae24ff79 100644 --- a/src/xrpld/app/rdb/WasmTrace.h +++ b/src/xrpld/app/rdb/WasmTrace.h @@ -1,5 +1,5 @@ -#ifndef RIPPLE_APP_RDB_WasmTrace_H_INCLUDED -#define RIPPLE_APP_RDB_WasmTrace_H_INCLUDED +#ifndef XRPL_APP_RDB_WasmTrace_H_INCLUDED +#define XRPL_APP_RDB_WasmTrace_H_INCLUDED #include #include From f6b18aee8203af1e6e76f97da23952259f9baa99 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 8 Jan 2026 12:53:10 -0500 Subject: [PATCH 09/10] fix merge issues (renames) --- src/xrpld/app/main/Application.cpp | 4 ++-- src/xrpld/app/rdb/WasmTrace.h | 4 ++-- src/xrpld/app/rdb/detail/WasmTrace.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index e7bf016a6a0..1b1973da8a9 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -815,7 +815,7 @@ class ApplicationImp : public Application, public BasicApp { XRPL_ASSERT( mWasmTraceDB, - "ripple::ApplicationImp::getWasmTraceDB : null wasm debug " + "xrpl::ApplicationImp::getWasmTraceDB : null wasm debug " "database"); return *mWasmTraceDB; } @@ -837,7 +837,7 @@ class ApplicationImp : public Application, public BasicApp "database"); XRPL_ASSERT( mWasmTraceDB.get() == nullptr, - "ripple::ApplicationImp::initRelationalDatabase : null wasm debug " + "xrpl::ApplicationImp::initRelationalDatabase : null wasm debug " "database"); try diff --git a/src/xrpld/app/rdb/WasmTrace.h b/src/xrpld/app/rdb/WasmTrace.h index 2cfae24ff79..915561ed68e 100644 --- a/src/xrpld/app/rdb/WasmTrace.h +++ b/src/xrpld/app/rdb/WasmTrace.h @@ -8,7 +8,7 @@ #include -namespace ripple { +namespace xrpl { std::unique_ptr makeWasmTraceDB(DatabaseCon::Setup const& setup, beast::Journal j); @@ -23,6 +23,6 @@ addWasmTraceLogs( std::map> getWasmTraceByTxID(soci::session& session, TxID const& txId); -} // namespace ripple +} // namespace xrpl #endif diff --git a/src/xrpld/app/rdb/detail/WasmTrace.cpp b/src/xrpld/app/rdb/detail/WasmTrace.cpp index 6f12fa9765a..43f3dc69e20 100644 --- a/src/xrpld/app/rdb/detail/WasmTrace.cpp +++ b/src/xrpld/app/rdb/detail/WasmTrace.cpp @@ -2,7 +2,7 @@ #include -namespace ripple { +namespace xrpl { std::unique_ptr makeWasmTraceDB(DatabaseCon::Setup const& setup, beast::Journal j) @@ -72,4 +72,4 @@ getWasmTraceByTxID(soci::session& session, TxID const& txId) return ret; } -} // namespace ripple +} // namespace xrpl From 54f487896332ea00b1096595c7ac2830b8ff89d2 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 4 Feb 2026 17:07:43 -0500 Subject: [PATCH 10/10] fix pre-commit --- src/xrpld/app/rdb/WasmTrace.h | 6 +----- src/xrpld/app/rdb/detail/WasmTrace.cpp | 13 ++----------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/xrpld/app/rdb/WasmTrace.h b/src/xrpld/app/rdb/WasmTrace.h index 915561ed68e..301f819a5fc 100644 --- a/src/xrpld/app/rdb/WasmTrace.h +++ b/src/xrpld/app/rdb/WasmTrace.h @@ -14,11 +14,7 @@ std::unique_ptr makeWasmTraceDB(DatabaseCon::Setup const& setup, beast::Journal j); void -addWasmTraceLogs( - soci::session& session, - TxID const& txId, - Keylet const& keylet, - std::vector const& data); +addWasmTraceLogs(soci::session& session, TxID const& txId, Keylet const& keylet, std::vector const& data); std::map> getWasmTraceByTxID(soci::session& session, TxID const& txId); diff --git a/src/xrpld/app/rdb/detail/WasmTrace.cpp b/src/xrpld/app/rdb/detail/WasmTrace.cpp index 43f3dc69e20..262cb7c4961 100644 --- a/src/xrpld/app/rdb/detail/WasmTrace.cpp +++ b/src/xrpld/app/rdb/detail/WasmTrace.cpp @@ -8,20 +8,11 @@ std::unique_ptr makeWasmTraceDB(DatabaseCon::Setup const& setup, beast::Journal j) { // WASM debug log database - return std::make_unique( - setup, - WasmTraceDBName, - std::array(), - WasmTraceDBInit, - j); + return std::make_unique(setup, WasmTraceDBName, std::array(), WasmTraceDBInit, j); } void -addWasmTraceLogs( - soci::session& session, - TxID const& txId, - Keylet const& keylet, - std::vector const& data) +addWasmTraceLogs(soci::session& session, TxID const& txId, Keylet const& keylet, std::vector const& data) { soci::transaction tr(session);