Skip to content

experimental: WASM trace logs stored in a db and outputted in tx#5980

Draft
mvadari wants to merge 19 commits intoXRPLF:ripple/smart-escrowfrom
mvadari:debug-db
Draft

experimental: WASM trace logs stored in a db and outputted in tx#5980
mvadari wants to merge 19 commits intoXRPLF:ripple/smart-escrowfrom
mvadari:debug-db

Conversation

@mvadari
Copy link
Collaborator

@mvadari mvadari commented Oct 31, 2025

High Level Overview of Change

This PR takes all the trace logs that are printed via host functions (so are dev-generated) and stores them in a separate database, which allows them to be printed as a part of tx.

Todo list for this PR:

  • Add tests
  • Add a config method that allows this to be disallowed (or perhaps it should be disallowed by default...)
  • Better reset/etc of the data, so it's not keeping it indefinitely

Context of Change

Easier debugging

Type of Change

  • New feature (non-breaking change which adds functionality)

API Impact

Adds a wasm_debug_logs field to the tx output for any transaction that executes WASM (currently just EscrowFinish).

Test Plan

TODO

@mvadari mvadari added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Oct 31, 2025
@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

❌ Patch coverage is 58.75000% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.8%. Comparing base (ff39fa5) to head (014706c).

Files with missing lines Patch % Lines
src/xrpld/app/rdb/detail/WasmTrace.cpp 36.7% 19 Missing ⚠️
src/xrpld/rpc/handlers/Tx.cpp 15.4% 11 Missing ⚠️
src/xrpld/app/tx/detail/Escrow.cpp 80.0% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                  @@
##           ripple/smart-escrow   #5980     +/-   ##
=====================================================
- Coverage                 79.8%   79.8%   -0.0%     
=====================================================
  Files                      846     847      +1     
  Lines                    73679   73753     +74     
  Branches                  8304    8334     +30     
=====================================================
+ Hits                     58804   58839     +35     
- Misses                   14875   14914     +39     
Files with missing lines Coverage Δ
include/xrpl/core/JobTypes.h 98.8% <100.0%> (+<0.1%) ⬆️
src/xrpld/app/main/Application.cpp 69.2% <100.0%> (+0.2%) ⬆️
src/xrpld/app/main/Application.h 100.0% <ø> (ø)
src/xrpld/app/wasm/HostFuncImpl.h 100.0% <100.0%> (ø)
src/xrpld/app/wasm/detail/HostFuncImpl.cpp 100.0% <100.0%> (ø)
src/xrpld/app/tx/detail/Escrow.cpp 98.9% <80.0%> (-0.5%) ⬇️
src/xrpld/rpc/handlers/Tx.cpp 86.8% <15.4%> (-6.4%) ⬇️
src/xrpld/app/rdb/detail/WasmTrace.cpp 36.7% <36.7%> (ø)

... and 3 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DraftRunCI Normally CI does not run on draft PRs. This opts in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant