Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services/horizon/internal/integration: Add load test which generates ledgers loaded with soroban Tx Meta #5556

Merged
merged 16 commits into from
Jan 8, 2025

Conversation

tamirms
Copy link
Contributor

@tamirms tamirms commented Dec 20, 2024

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with name of package that is most changed in the PR, ex.
    services/friendbot, or all or doc if the changes are broad or impact many
    packages.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated any docs (developer docs, .md
    files, etc... affected by this change). Take a look in the docs folder for a given service,
    like this one.

Release planning

  • I've reviewed the changes in this PR and if I consider them worthwhile for being mentioned on release notes then I have updated the relevant CHANGELOG.md within the component folder structure. For example, if I changed horizon, then I updated (services/horizon/CHANGELOG.md. I add a new line item describing the change and reference to this PR. If I don't update a CHANGELOG, I acknowledge this PR's change may not be mentioned in future release notes.
  • I've decided if this PR requires a new major/minor version according to
    semver, or if it's mainly a patch change. The PR is targeted at the next
    release branch if it's not a patch change.

What

Close stellar/stellar-rpc#330

This PR implements an integration load test to generate ledgers with soroban transactions. The test can be configured using the following parameters:

  • transactions-per-ledger number of transactions per ledger
  • transfers-per-tx number of asset transfers for each transaction
  • ledgers number of ledgers to generate

The test will output ledgers number of ledgers each containing transactions-per-ledger transactions. Each transaction will have transfers-per-tx asset transfers. Half the asset transfers will result in movement among accounts and the other half of the transfers will result in movement between accounts and contracts.

The test is implemented as follows:

  1. We use clients/stellarcore: Support more parameters from the upgrades endpoint #5546 to setup a private stellar network with unlimited soroban TPS.
  2. We use a bulk transfer soroban contract which will allow us to have a single invocation which transfers assets to multiple destination accounts / contracts
  3. We submit many soroban transactions to core
  4. We merge ledgers together until we until we have sufficient data to populate the ledger data which satisfies the configuration parameters.

The transactions are carefully designed to make the merging operation safe. In particular, we ensure that the source / fee account of each transaction is not used or modified more than once within the batch of ledgers which will be merged.

Why

Currently, the number of soroban transactions per ledger is limited but in the future we plan to raise that limit. But before doing so, we would like to use this tool to generate ledgers with a high volume of soroban activity so we can test the limits of horizon and rpc ingestion.

#5482

Known limitations

[N/A]

@tamirms tamirms changed the title Add load test which generates ledgers loaded with soroban Tx Meta services/horizon/internal/integration: Add load test which generates ledgers loaded with soroban Tx Meta Dec 20, 2024
@tamirms tamirms marked this pull request as ready for review January 3, 2025 18:54
@tamirms tamirms requested a review from a team January 3, 2025 18:57
@2opremio
Copy link
Contributor

2opremio commented Jan 7, 2025

Really cool. I wonder, though, if this could be factored out in some way so that it can be reused in Stellar-RPC tests. Or is the idea to simply compile the test and pass parameters to it? that isn't very flexible though.

@tamirms
Copy link
Contributor Author

tamirms commented Jan 8, 2025

I wonder, though, if this could be factored out in some way so that it can be reused in Stellar-RPC tests.

yeah, ideally this could be executed outside the context of a Go test. But, there is a lot of code in the integration testing framework we have which makes it easy to spin up and tear down the stand alone stellar network. It would require much more effort to decouple that framework code from testing.T.

Or is the idea to simply compile the test and pass parameters to it? that isn't very flexible though.

My intention was to use this test to generate a bunch of ledgers. Once we have the file with the generated ledgers we can replay them to rpc / horizon. The generated ledgers file is the only artifact we need to load test ingestion in horizon / rpc

@tamirms tamirms merged commit bd9fa3f into stellar:master Jan 8, 2025
23 checks passed
@tamirms tamirms deleted the load-test branch January 8, 2025 13:22
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.

Create artificial soroban meta generator
2 participants