ingest/loadtest: add embedding for default apply-load config#5942
Open
cjonas9 wants to merge 6 commits into
Open
ingest/loadtest: add embedding for default apply-load config#5942cjonas9 wants to merge 6 commits into
cjonas9 wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates ingest/loadtest’s apply-load runner to ship a built-in default stellar-core apply-load config (via go:embed) and changes the API so callers can optionally supply their own config as raw bytes rather than a filesystem path.
Changes:
- Add and embed a default apply-load config file (
configs/default-apply-load.cfg) and expose it viaDefaultConfig(). - Update
Optionsto acceptConfig []byte(optional) instead ofConfigPath string, defaulting to the embedded config when nil. - Refactor config parsing/tests to operate on in-memory config bytes instead of reading from disk.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ingest/loadtest/configs/default-apply-load.cfg | Adds the package-shipped default apply-load configuration that will be embedded. |
| ingest/loadtest/apply_load.go | Embeds/exposes the default config, changes Options API to accept config bytes, and writes config bytes into the workdir before invoking stellar-core. |
| ingest/loadtest/apply_load_test.go | Updates config parsing tests to use DefaultConfig() / in-memory config bytes rather than a testdata file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tamirms
reviewed
May 11, 2026
| // DefaultConfig returns the contents of the default apply-load configuration | ||
| // shipped with this package. | ||
| func DefaultConfig() []byte { | ||
| return append([]byte(nil), defaultConfig...) |
Contributor
There was a problem hiding this comment.
I think you can return defaultConfig without creating a copy because I don't think the slice is modified
tamirms
approved these changes
May 11, 2026
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.
PR Checklist
PR Structure
otherwise).
services/friendbot, orallordocif the changes are broad or impact manypackages.
Thoroughness
.mdfiles, etc... affected by this change). Take a look in the
docsfolder for a given service,like this one.
Release planning
CHANGELOG.mdwithin 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.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
//go:embeddirective for the default config, now shipped with the packageDefaultConfig()to the package and makes supplying one's own config optionalOptions{}now takes the config as[]byterather than as a path to the configWhy
In Horizon and RPC, this config is sufficient for most use cases. For use cases outside of this, it's acceptable to make a custom, purpose-built config that documents itself/the reasons the default was insufficient. To reduce the surface-area of the call, configs can be supplied as []byte so the caller can use the default config directly (as opposed to having to access the embedding and then write it somewhere to get a
configPath).This is being done now (prior to migrating the Horizon/RPC loadtests to use the new SDK loadtest tooling) as a minor change to avoid having follow-up PRs across each of SDK, RPC, and Horizon.
Known limitations
N/A