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

exp/ingest: Fix fee and transaction meta processing #2050

Merged

Conversation

bartekn
Copy link
Contributor

@bartekn bartekn commented Dec 12, 2019

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

This commit changes io.LedgerTransaction to return fee and tx meta separately and updates Horizon processors to apply changes in correct order. This issue was found by StateVerifier.

Close #2038.

Why

The order of applying meta changes in Horizon processors was incorrect. Fee changes must be applied before everything else. In other words instead of processing meta like:

TX1_FEE_META, TX1_TX_META, TX2_FEE_META, TX2_TX_META, ...

we should do it like:

TX1_FEE_META, TX2_FEE_META, TX1_TX_META, TX2_TX_META, ...

Known limitations

As you can see the current interface of pipeline processor doesn't make sense because all transactions need to be read into memory first to apply fee changes. We either need to refactor the processors or use @tamirms design where pipeline is removed (I'm leaning toward the latter). I'll create an issue about this tomorrow.

@tamirms
Copy link
Contributor

tamirms commented Dec 12, 2019

@bartekn how did you determine what the correct order of operations is? did you get this information from reading stellar core? would it be worth having someone from the stellar core team to review the ledger processor at a high level?

@bartekn
Copy link
Contributor Author

bartekn commented Dec 12, 2019

how did you determine what the correct order of operations is? did you get this information from reading stellar core?

I read this doc one more time and realized my understanding of the order is incorrect (actually added a PR to make it less confusing: stellar/stellar-core#2366). It was also confirmed by @jonjove in Slack. And finally state verification of the range that failed before works now.

@bartekn bartekn merged commit fb5f489 into stellar:release-horizon-v0.24.1 Dec 12, 2019
@bartekn bartekn deleted the fix-tx-fee-meta-processing branch December 12, 2019 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants