Add Soroswap benchmark mode for apply load.#5204
Open
dmkozh wants to merge 3 commits intostellar:masterfrom
Open
Add Soroswap benchmark mode for apply load.#5204dmkozh wants to merge 3 commits intostellar:masterfrom
dmkozh wants to merge 3 commits intostellar:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new apply-load benchmark “model transaction” options to better simulate real-world Soroban workloads (custom token transfers and Soroswap swaps), including contract/Wasm setup paths and acceptance tests.
Changes:
- Extend
ApplyLoadModelTxto supportCUSTOM_TOKENandSOROSWAP, with corresponding setup + transaction generation inApplyLoad. - Add token + Soroswap contract Wasms and Rust bridge accessors to embed them into Core for apply-load setup.
- Add acceptance tests and example configs for the new benchmark modes.
Reviewed changes
Copilot reviewed 23 out of 28 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/simulation/TxGenerator.h | Adds instruction constants and a new Soroban token-transfer generator API. |
| src/simulation/TxGenerator.cpp | Implements invokeTokenTransfer for custom token transfers. |
| src/simulation/ApplyLoad.h | Adds setup/generation helpers and Soroswap benchmark state. |
| src/simulation/ApplyLoad.cpp | Implements custom token + Soroswap setup and tx generation; refactors benchmarking path. |
| src/main/Config.h | Extends ApplyLoadModelTx enum. |
| src/main/Config.cpp | Parses new APPLY_LOAD_MODEL_TX values and updates error message. |
| src/simulation/test/LoadGeneratorTests.cpp | Adds acceptance tests for benchmark SAC/custom-token/Soroswap and classic TX mix. |
| src/rust/src/soroban_test_wasm.rs | Exposes embedded apply-load Wasms via Rust helpers. |
| src/rust/src/bridge.rs | Adds Rust bridge function declarations for the new Wasm getters. |
| src/rust/apply-load-wasm/* | Adds embedded Wasm blobs (token + Soroswap factory/pool/router) and a README. |
| scripts/apply_load/token/** | Adds the source workspace and tests for building the custom token Wasm. |
| docs/apply-load-benchmark-token.cfg | Adds example config for benchmarking custom token transfers. |
| docs/apply-load-benchmark-sac.cfg | Updates SAC benchmark config header wording. |
| Builds/VisualStudio/build_rust.bat | Adjusts Rust build flow to rely on cargo’s incremental tracking. |
| Builds/VisualStudio/stellar-core.vcxproj* | Adds SecretManager sources to the VS project files. |
src/simulation/ApplyLoad.cpp
Outdated
| { | ||
| setupBatchTransferContracts(); | ||
| } | ||
| // Setup initital bucket list for modes that support it. |
There was a problem hiding this comment.
Typo in comment: initital should be initial.
Suggested change
| // Setup initital bucket list for modes that support it. | |
| // Setup initial bucket list for modes that support it. |
31b496a to
72f787a
Compare
marta-lokhova
previously approved these changes
Apr 7, 2026
The merge-base changed after approval.
72f787a to
935c7d6
Compare
935c7d6 to
e0ee4d3
Compare
marta-lokhova
approved these changes
Apr 8, 2026
This mode uses the official Soroswap contracts from mainnet. It executes swaps of different token pairs (to allow for parallelism).
e0ee4d3 to
245aacb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This mode uses the official Soroswap contracts from mainnet. It executes swaps of different token pairs (to allow for parallelism).
This is based on #5201
Checklist
clang-formatv8.0.0 (viamake formator the Visual Studio extension)