Skip to content

Add a custom token transfer benchmark mode for apply load. - #5200

Merged
dmkozh merged 1 commit into
stellar:masterfrom
dmkozh:apply_load_custom_token
Apr 3, 2026
Merged

dmkozh merged 1 commit into
stellar:masterfrom
dmkozh:apply_load_custom_token

Conversation

@dmkozh

@dmkozh dmkozh commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Description

Add a custom token transfer benchmark mode for apply load.

The token has been generated with OpenZeppelin contract wizard with minimal customization (batch mint support).

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

Copilot AI review requested due to automatic review settings April 1, 2026 23:28
@socket-security

socket-security Bot commented Apr 1, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​soroban-sdk@​23.5.38210093100100
Addedcargo/​stellar-contract-utils@​0.6.08310093100100
Addedcargo/​stellar-access@​0.6.010010093100100
Addedcargo/​stellar-macros@​0.6.010010093100100
Addedcargo/​stellar-tokens@​0.6.010010093100100

View full report

@socket-security

socket-security Bot commented Apr 1, 2026 •

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

Copilot AI 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.

Pull request overview

Adds a new ApplyLoadModelTx::CUSTOM_TOKEN path to the apply-load benchmark tooling, enabling benchmarking ledger close time using transfers of a bundled custom Soroban token contract (Wasm) rather than SAC transfers.

Changes:

  • Extend apply-load model-tx selection/config parsing to support custom_token, with docs + example config.
  • Add token contract deployment + minting setup, and generate conflict-free token transfer transactions for benchmark mode.
  • Bundle a prebuilt token Wasm (and its source workspace under scripts/) and wire it through the Rust bridge.

Reviewed changes

Copilot reviewed 21 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/simulation/TxGenerator.h Adds instruction constant + invokeTokenTransfer declaration.
src/simulation/TxGenerator.cpp Implements invokeTokenTransfer Soroban tx construction/resources/footprint.
src/simulation/test/LoadGeneratorTests.cpp Adds acceptance test covering custom-token benchmark mode.
src/simulation/ApplyLoad.h Adds token setup/generation APIs + token contract instance storage.
src/simulation/ApplyLoad.cpp Adds token contract setup (upload/create/multi_mint) + transfer generation; refactors benchmark helper naming and setup flow.
src/rust/src/soroban_test_wasm.rs Exposes get_apply_load_token_wasm() using include_bytes!.
src/rust/src/bridge.rs Exposes get_apply_load_token_wasm() over the CXX bridge.
src/rust/apply-load-wasm/token.wasm Adds the custom token contract Wasm blob used by apply-load.
src/rust/apply-load-wasm/README..md Documents the new apply-load Wasm directory and token Wasm provenance.
src/main/Config.h Adds ApplyLoadModelTx::CUSTOM_TOKEN enum value.
src/main/Config.cpp Parses APPLY_LOAD_MODEL_TX="custom_token" and updates error message.
scripts/apply_load/token/contracts/token/test_snapshots/test/smoke_multi_mint_and_transfer.1.json Adds Soroban snapshot fixture for token smoke test.
scripts/apply_load/token/contracts/token/test_snapshots/test/initial_state.1.json Adds Soroban snapshot fixture for token initial state.
scripts/apply_load/token/contracts/token/src/test.rs Adds Rust test for multi_mint + transfer behavior/auth.
scripts/apply_load/token/contracts/token/src/lib.rs Adds token contract crate module wiring.
scripts/apply_load/token/contracts/token/src/contract.rs Implements token contract with multi_mint plus standard fungible interfaces.
scripts/apply_load/token/contracts/token/Cargo.toml Adds token contract crate manifest.
scripts/apply_load/token/Cargo.toml Adds standalone workspace for building the apply-load token contract.
scripts/apply_load/token/Cargo.lock Adds lockfile for the apply-load token contract workspace.
scripts/apply_load/token/.gitignore Ignores build outputs and local Soroban settings for the workspace.
docs/apply-load-benchmark-token.cfg Adds example config for benchmarking custom token transfers.
docs/apply-load-benchmark-sac.cfg Updates SAC benchmark doc comment to reflect multiple model tx options.
Builds/VisualStudio/build_rust.bat Adjusts Rust build behavior (clear RUSTFLAGS; always invoke cargo for stellar-core).

Comment thread src/simulation/ApplyLoad.cpp Resolved
Comment thread src/simulation/ApplyLoad.cpp Resolved
Comment thread src/rust/apply-load-wasm/README.md Resolved
Comment thread src/rust/apply-load-wasm/README..md Resolved
The token has been generated with OpenZeppeling contract wizard with minimal customization (batch mint support).
@dmkozh
dmkozh force-pushed the apply_load_custom_token branch from 15b3f24 to 76f3688 Compare April 2, 2026 00:45
@dmkozh
dmkozh requested review from SirTyson and marta-lokhova April 3, 2026 16:45

@marta-lokhova marta-lokhova 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.

Full disclosure: I haven't done a comprehensive review of this change. But since it's test-only code it's very low risk, and we can iterate on it outside of this PR if needed. Approving so we can get this work unblocked

@dmkozh
dmkozh added this pull request to the merge queue Apr 3, 2026
Merged via the queue into stellar:master with commit b04ae42 Apr 3, 2026
53 checks passed
@dmkozh
dmkozh deleted the apply_load_custom_token branch April 3, 2026 18:03
github-merge-queue Bot pushed a commit that referenced this pull request Apr 8, 2026
# Description

Generate classic transactions in every apply load mode.

Based on #5200.

# Checklist
- [ ] Reviewed the
[contributing](https://github.com/stellar/stellar-core/blob/master/CONTRIBUTING.md#submitting-changes)
document
- [ ] Rebased on top of master (no merge commits)
- [ ] Ran `clang-format` v8.0.0 (via `make format` or the Visual Studio
extension)
- [ ] Compiles
- [ ] Ran all tests
- [ ] If change impacts performance, include supporting evidence per the
[performance
document](https://github.com/stellar/stellar-core/blob/master/performance-eval/performance-eval.md)
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.

3 participants