Skip to content

fix: Add perf tests for escrow create and escrow finish#7789

Open
TimothyBanks wants to merge 8 commits into
ripple/smart-escrowfrom
smart-escrow/perf-test
Open

fix: Add perf tests for escrow create and escrow finish#7789
TimothyBanks wants to merge 8 commits into
ripple/smart-escrowfrom
smart-escrow/perf-test

Conversation

@TimothyBanks

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Adds very simple perf test around escrow create and escrow finish calls.

Context of Change

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)

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Test assertion always fails — see inline comment.

Review by Claude Sonnet 4.6 · Prompt: V15

Comment thread src/test/app/Wasm_test.cpp Outdated
auto mock = HostFunctions{env.journal};
auto hfns = TestHostFunctions{env, 0};

perf(hfns, kRuns, [&] { return !preflightEscrowWasm(wasm, mock, escrowFunctionName); });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mock is passed to preflightEscrowWasm but perf() checks hfns.execTimeEvent->count — assertion always fails. Pass hfns instead:

Suggested change
perf(hfns, kRuns, [&] { return !preflightEscrowWasm(wasm, mock, escrowFunctionName); });
perf(hfns, kRuns, [&] { return !preflightEscrowWasm(wasm, hfns, escrowFunctionName); });

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Had a look at this

Two correctness issues flagged inline: nanosecond timing is silently truncated to milliseconds by Event::notify (both timing sites in WasmVM.cpp), and the destructor unconditionally prints to stdout for every test instance, not just the perf tests.


Review by ReviewBot 🤖

Review by Claude Sonnet 4.6 · Prompt: V15

Comment thread src/libxrpl/tx/wasm/WasmVM.cpp Outdated
Comment thread src/test/app/TestHostFunctions.h Outdated

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One unused variable flagged inline — see line 1588.


Review by ReviewBot 🤖

Review by Claude Sonnet 4.6 · Prompt: V15

Comment thread src/test/app/Wasm_test.cpp Outdated

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant