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: Add --max-assets-per-path-request flag #4046

Merged
merged 2 commits into from
Nov 5, 2021

Conversation

erika-sdf
Copy link
Contributor

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 updated the relevant CHANGELOG (here for Horizon) if
    needed with deprecations, added features, breaking changes, and DB schema changes.
  • 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

Introduce a flag that sets the max number of assets to consider during strict-send or strict-receive.

Why

The maximum (15) is hardcoded, and making it configurable grants users some flexibility.

Known limitations

N/A

@erika-sdf erika-sdf linked an issue Nov 4, 2021 that may be closed by this pull request
@erika-sdf erika-sdf force-pushed the flag branch 2 times, most recently from eefb01c to 4d7d6a6 Compare November 4, 2021 21:23
@erika-sdf erika-sdf requested review from tamirms and a team November 4, 2021 21:24
@erika-sdf erika-sdf force-pushed the flag branch 3 times, most recently from 97021a3 to a40969c Compare November 4, 2021 23:58
@@ -7,7 +7,8 @@ file. This project adheres to [Semantic Versioning](http://semver.org/).

### Changes

* Add an endpoint that allows querying for which liquidity pools an account is participating in
* Add a new feature flag `--max-assets-per-path_request` (`15` by default) that sets the number of assets to consider for strict-send and strict-recieve ([4046](https://github.com/stellar/go/pull/4046))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I would replace "feature flag" with "horizon flag"

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Add a new feature flag `--max-assets-per-path_request` (`15` by default) that sets the number of assets to consider for strict-send and strict-recieve ([4046](https://github.com/stellar/go/pull/4046))
* Add a new feature flag `--max-assets-per-path-request` (`15` by default) that sets the number of assets to consider for strict-send and strict-recieve ([4046](https://github.com/stellar/go/pull/4046))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -7,7 +7,8 @@ file. This project adheres to [Semantic Versioning](http://semver.org/).

### Changes

* Add an endpoint that allows querying for which liquidity pools an account is participating in
* Add a new feature flag `--max-assets-per-path_request` (`15` by default) that sets the number of assets to consider for strict-send and strict-recieve ([4046](https://github.com/stellar/go/pull/4046))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Add a new feature flag `--max-assets-per-path_request` (`15` by default) that sets the number of assets to consider for strict-send and strict-recieve ([4046](https://github.com/stellar/go/pull/4046))
* Add a new feature flag `--max-assets-per-path-request` (`15` by default) that sets the number of assets to consider for strict-send and strict-recieve ([4046](https://github.com/stellar/go/pull/4046))

@marcinx
Copy link
Contributor

marcinx commented Nov 5, 2021

Is it possible to bump up the default though? 15 seems arbitrary and looking at response times of requests with 15 assets, the pathfinder should be able to handle a multiple of that easily.

Trying to avoid situations where we use, e.g. 100, on our deployment and are not able to fall back to SDF Horizon (during maintenance/downtime/upgrades/disaster recovery etc.) because of a much lower constraint. @bartekn

@ire-and-curses
Copy link
Member

@marcinx We're not going to change this number for SDF's Horizon in the near future. It's unclear what the impact of raising the number is for our load. We have a large number of requests, and even small performance changes have large consequences when multiplied across all our traffic. We would need to simulate that before making any tweaks here.

As far as fall back goes, if your use case requires this very large path, it would be a great idea to consider a backup or secondary cluster for the scenarios you mentioned. It is dangerous in general, and not recommended, to rely on the SDF Horizon instance for production use.

@marcinx
Copy link
Contributor

marcinx commented Nov 5, 2021

@ire-and-curses Okay, thanks for the reply. That's a good idea and I had a setup with a separate Horizon instance just for path payments in mind already. Or maybe we'll come up with a way to iterate over path requests in our code eventually.

@erika-sdf erika-sdf merged commit 2226900 into stellar:master Nov 5, 2021
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.

Feature Request: maxAssetsForPathFinding should be configurable
5 participants