Repository navigation
Add a custom token transfer benchmark mode for apply load. - #5200
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
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. |
There was a problem hiding this comment.
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). |
The token has been generated with OpenZeppeling contract wizard with minimal customization (batch mint support).
15b3f24 to
76f3688
Compare
marta-lokhova
left a comment
There was a problem hiding this comment.
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
# 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)
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
clang-formatv8.0.0 (viamake formator the Visual Studio extension)