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

Karthik/5438/deprecate horizon fields for protocol 22 #5478

Conversation

karthikiyer56
Copy link
Contributor

@karthikiyer56 karthikiyer56 commented Sep 27, 2024

Remove deprecated fields from horizon in protocol 22 release as a part of issue 5438 (https://github.com//issues/5438)

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

  • This PR removes 4 fields that have been deprecated, and were waiting for the next protocol release to be rolled out.
    They are numAccounts, amount, validBefore, validAfter from the AssetStat structure in services/horizon/protocols/main.go
  • Additionally, the num_accounts and amount columns are also dropped from the exp_asset_stat tables and the DB bindings and code are removed

The PR that updates/removes the references for these deprecated fields from the stellar-docs is: stellar/stellar-docs#1014

@karthikiyer56
Copy link
Contributor Author

karthikiyer56 commented Sep 27, 2024

As a part of this cleanup/deprecation task, I think the fields in Db structure ExpAssetStat also need to be removed.
I think that means the 2 rows in expat_asset_stat table need to be dropped.
can someone confirm if that is true?

horizon=# select   * from exp_asset_stats;
-[ RECORD 1 ]+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
asset_type   | 1
asset_code   | RFQP
asset_issuer | GDKFYFGSVF5F3JI32O5HPNXGVVQISKL5KYGOMW4V7IVNBERXA2EM4LBK
amount       | 0
num_accounts | 0
accounts     | {"authorized": 0, "unauthorized": 1, "liquidity_pools": 0, "claimable_balances": 0, "authorized_to_maintain_liabilities": 0}
balances     | {"authorized": "0", "unauthorized": "0", "liquidity_pools": "0", "claimable_balances": "0", "authorized_to_maintain_liabilities": "0"}
contract_id  |
-[ RECORD 2 ]+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
asset_type   | 1
asset_code   | MOON
asset_issuer | GDYIDXQRQLDKXDKOQ3RGWLUO2HMCQ2NTC35ZVG6QYOQY6XA5IGMI4IA6
amount       | 1000000000
num_accounts | 2
accounts     | {"authorized": 2, "unauthorized": 0, "liquidity_pools": 0, "claimable_balances": 0, "authorized_to_maintain_liabilities": 0}
balances     | {"authorized": "1000000000", "unauthorized": "0", "liquidity_pools": "0", "claimable_balances": "0", "authorized_to_maintain_liabilities": "0"}
contract_id  |
-[ RECORD 3 ]+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
asset_type   | 2
asset_code   | LQS1000008
asset_issuer | GAIRVTVFTAWHCJ3UOVXOVMLBJ2E325ZO5P6V5QPPPXVIANX6ATJMFILW
amount       | 10000000
num_accounts | 2
accounts     | {"authorized": 2, "unauthorized": 0, "liquidity_pools": 0, "claimable_balances": 0, "authorized_to_maintain_liabilities": 0}
balances     | {"authorized": "10000000", "unauthorized": "0", "liquidity_pools": "0", "claimable_balances": "0", "authorized_to_maintain_liabilities": "0"}
contract_id  |

.gitignore Show resolved Hide resolved
@tamirms
Copy link
Contributor

tamirms commented Sep 27, 2024

@karthikiyer56

As a part of this cleanup/deprecation task, I think the fields in Db structure ExpAssetStat also need to be removed.
I think that means the 2 rows in expat_asset_stat table need to be dropped.
can someone confirm if that is true?

Yes, you're correct. You will need to add a new migration which removes the amount and num_accounts columns from the exp_asset_stats table. Here is an example of a migration which does something similar that you can use as a reference point:

https://github.com/stellar/go/blob/master/services/horizon/internal/db2/schema/migrations/35_drop_participant_id.sql

@karthikiyer56
Copy link
Contributor Author

@karthikiyer56

As a part of this cleanup/deprecation task, I think the fields in Db structure ExpAssetStat also need to be removed.
I think that means the 2 rows in expat_asset_stat table need to be dropped.
can someone confirm if that is true?

Yes, you're correct. You will need to add a new migration which removes the amount and num_accounts columns from the exp_asset_stats table. Here is an example of a migration which does something similar that you can use as a reference point:

https://github.com/stellar/go/blob/master/services/horizon/internal/db2/schema/migrations/35_drop_participant_id.sql

@tamirms
done

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.

5 participants