Skip to content

Add Soroswap benchmark mode for apply load.#5204

Open
dmkozh wants to merge 3 commits intostellar:masterfrom
dmkozh:apply_load_soroswap
Open

Add Soroswap benchmark mode for apply load.#5204
dmkozh wants to merge 3 commits intostellar:masterfrom
dmkozh:apply_load_soroswap

Conversation

@dmkozh
Copy link
Copy Markdown
Contributor

@dmkozh dmkozh commented Apr 3, 2026

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

  • 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 3, 2026 00:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ApplyLoadModelTx to support CUSTOM_TOKEN and SOROSWAP, with corresponding setup + transaction generation in ApplyLoad.
  • 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.

{
setupBatchTransferContracts();
}
// Setup initital bucket list for modes that support it.
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@dmkozh dmkozh requested a review from marta-lokhova April 6, 2026 21:23
@dmkozh dmkozh force-pushed the apply_load_soroswap branch 3 times, most recently from 31b496a to 72f787a Compare April 6, 2026 22:09
marta-lokhova
marta-lokhova previously approved these changes Apr 7, 2026
@dmkozh dmkozh dismissed marta-lokhova’s stale review April 8, 2026 05:21

The merge-base changed after approval.

@dmkozh dmkozh force-pushed the apply_load_soroswap branch from 72f787a to 935c7d6 Compare April 8, 2026 15:43
@dmkozh dmkozh enabled auto-merge April 8, 2026 15:44
@dmkozh dmkozh force-pushed the apply_load_soroswap branch from 935c7d6 to e0ee4d3 Compare April 8, 2026 15:54
dmkozh added 3 commits April 8, 2026 15:37
This mode uses the official Soroswap contracts from mainnet. It executes swaps of different token pairs (to allow for parallelism).
@dmkozh dmkozh force-pushed the apply_load_soroswap branch from e0ee4d3 to 245aacb Compare April 8, 2026 19:37
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