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: Correctly check trustline flags to classify asset balances #3847

Merged

Conversation

paulbellamy
Copy link
Contributor

@paulbellamy paulbellamy commented Aug 25, 2021

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

Use the method accessors to check which flags are set on a trustline.

Why

Fixes #3846

Direct byte-comparison misses combination flags, e.g. TrustLineAuthorized | TrustLineClawbackEnabled, and classifies them as unauthorized.

Known limitations

[TODO or N/A]

@paulbellamy paulbellamy requested a review from bartekn August 25, 2021 14:05
Copy link
Contributor

@bartekn bartekn left a comment

Choose a reason for hiding this comment

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

LGTM! We also need to bump ingest.CurrentVersion to trigger state rebuild. Also I wonder if should merge it into master or a branch based on horizon-v2.8.0. Release branch is not merged yet so it's hard to tell what else is there that'd require testing.

@paulbellamy paulbellamy force-pushed the horizon/3846-misreported-asset-balances branch from c18fa8b to 5255fb3 Compare August 25, 2021 15:00
@paulbellamy paulbellamy changed the base branch from master to release-horizon-v2.8.0 August 25, 2021 16:17
@paulbellamy paulbellamy force-pushed the horizon/3846-misreported-asset-balances branch from 5255fb3 to 63916f2 Compare August 25, 2021 16:19
Copy link
Contributor

@Shaptic Shaptic left a comment

Choose a reason for hiding this comment

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

Just making sure: Targeting the release-horizon-v2.8.0 branch is intentional, right?

@paulbellamy paulbellamy changed the base branch from release-horizon-v2.8.0 to release-horizon-v2.8.1 August 26, 2021 08:33
@paulbellamy paulbellamy merged this pull request into release-horizon-v2.8.1 Aug 26, 2021
@paulbellamy paulbellamy deleted the horizon/3846-misreported-asset-balances branch August 26, 2021 08:35
paulbellamy pushed a commit that referenced this pull request Aug 26, 2021
…alances (#3847)

* use method accessors for asset stats amount classification

* Update changelog

* bump ingest.CurrentVersion

* Fix up test Post rebase
paulbellamy pushed a commit that referenced this pull request Aug 27, 2021
…alances (#3847)

* use method accessors for asset stats amount classification

* Update changelog

* bump ingest.CurrentVersion

* Fix up test Post rebase
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.

Horizon is misreporting GET /assets authorized & unauthorized numbers
3 participants