8000 Add RPC "simulate" to execute a dry run of a transaction by mvadari · Pull Request #5069 · XRPLF/rippled · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add RPC "simulate" to execute a dry run of a transaction #5069

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

Merged
merged 87 commits into from
Jan 29, 2025

Conversation

mvadari
Copy link
Collaborator
@mvadari mvadari commented Jul 18, 2024

High Level Overview of Change

This PR adds a new API method, titled simulate, which executes a dry run of a transaction submission.

This PR also fixes #5070.

Context of Change

It is useful to take a transaction, simulate execution it in the current ledger, and return the metadata - but not persist the transaction in the ledger. This can be used for testing, analysis, and more.

XLS spec: XRPLF/XRPL-Standards#207

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

Test Plan

Testing is still in progress. Unit tests are and will be added.

Current Status

This PR is complete and ready for review. You can build this branch and sync with the network of your choice (including Mainnet). The public is welcome to test and use this code (at your own risk). Next steps are code review and QA testing.

Copy link
codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 98.21429% with 6 lines in your changes missing coverage. Please review.

Project coverage is 78.1%. Comparing base (50b8f19) to head (4845f7b).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
src/xrpld/rpc/detail/TransactionSign.cpp 94.0% 5 Missing ⚠️
src/xrpld/app/tx/detail/apply.cpp 90.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5069     +/-   ##
=========================================
+ Coverage     78.0%   78.1%   +0.1%     
=========================================
  Files          789     790      +1     
  Lines        67061   67279    +218     
  Branches      8108    8101      -7     
=========================================
+ Hits         52324   52562    +238     
+ Misses       14737   14717     -20     
Files with missing lines Coverage Δ
include/xrpl/protocol/ErrorCodes.h 100.0% <ø> (ø)
src/libxrpl/protocol/ErrorCodes.cpp 85.7% <ø> (ø)
src/libxrpl/protocol/InnerObjectFormats.cpp 100.0% <100.0%> (ø)
src/xrpld/app/ledger/detail/BuildLedger.cpp 91.4% <100.0%> (ø)
src/xrpld/app/ledger/detail/LedgerMaster.cpp 44.0% <100.0%> (+0.1%) ⬆️
src/xrpld/app/ledger/detail/OpenLedger.cpp 73.4% <100.0%> (+0.3%) ⬆️
src/xrpld/app/main/Main.cpp 79.8% <ø> (ø)
src/xrpld/app/misc/NetworkOPs.cpp 70.1% <100.0%> (+<0.1%) ⬆️
src/xrpld/app/misc/TxQ.h 98.2% <ø> (ø)
src/xrpld/app/misc/detail/TxQ.cpp 98.8% <100.0%> (+<0.1%) ⬆️
... and 18 more

... and 4 files with indirect coverage changes

Impacted file tree graph

@mvadari mvadari requested review from godexsoft and removed request for godexsoft July 18, 2024 21:49
Copy link
Collaborator
@Bronek Bronek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some minor remarks. I do not feel strongly about any of these, so please just do what you consider to be reasonable and ignore the rest.

Copy link
Collaborator
@oleks-rip oleks-rip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mvadari mvadari added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Jan 28, 2025
@ximinez ximinez changed the title feat: simulate RPC to dry-run a tx (XLS-69d) Add RPC "simulate" to execute a dry run of a transaction Jan 29, 2025
@ximinez ximinez merged commit dcc4581 into XRPLF:develop Jan 29, 2025
24 checks passed
@mvadari mvadari deleted the simulate branch January 29, 2025 16:45
@ximinez ximinez mentioned this pull request Jan 30, 2025
5 tasks
@intelliot intelliot added this to the 2.4.0 (2025) milestone Jan 30, 2025
This was referenced Feb 18, 2025
q73zhao pushed a commit that referenced this pull request Feb 24, 2025
- Spec: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0069d-simulate
- Also update signing methods to autofill fees better and properly handle transactions that require a non-standard fee.
This was referenced Feb 26, 2025
This was referenced Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sign-and-submit mode doesn't autofill 3F42 the correct tx fee (Version: rippled 2.1.0)
7 participants
0