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

Update ingestion to support metaV2 #1902

Closed
MonsieurNicolas opened this issue Nov 1, 2019 · 4 comments
Closed

Update ingestion to support metaV2 #1902

MonsieurNicolas opened this issue Nov 1, 2019 · 4 comments
Assignees
Labels
horizon ingest New ingestion system

Comments

@MonsieurNicolas
Copy link
Contributor

There is some missing meta in protocol version older than version 10. This impacts transactions with one time signers (that get removed after operations in v9 and earlier; and during signature verification in v10 and later). Those changes are invisible in the meta which may confuse certain ingestion processors that keep track of signers on accounts.

We're adding support for a new version of the meta that allows for changes both preceding (meta.v2().txChangesBefore is the same than meta.v1().txChanges) and succeeding operation level changes (meta.v2().txChangesAfter) in stellar/stellar-core#2315 that will be in build 12.2.0

The meta generation is behind a feature flag (disabled by default) for now in core, to enable the new meta format set in the configuration file:
SUPPORTED_META_VERSION=2

@ire-and-curses ire-and-curses added ingest New ingestion system horizon labels Nov 11, 2019
@ire-and-curses
Copy link
Member

Related issue: stellar/stellar-core#2217 (@bartek)

@ire-and-curses ire-and-curses added this to the Horizon 0.24.0 milestone Nov 12, 2019
@bartekn bartekn self-assigned this Nov 14, 2019
@bartekn
Copy link
Contributor

bartekn commented Nov 25, 2019

Testing this is blocked by https://github.com/stellar/puppet-v4/issues/942.

@ire-and-curses
Copy link
Member

Now depends on #1890

bartekn added a commit that referenced this issue Jan 9, 2020
This commit adds support for ingesting `TransactionMeta` when `V=2` and
updates XDR files.

As explained by @MonsieurNicolas in #1902.

> There is some missing meta in protocol version older than version 10.
This impacts transactions with one time signers (that get removed after
operations in v9 and earlier; and during signature verification in v10
and later). Those changes are invisible in the meta which may confuse
certain ingestion processors that keep track of signers on accounts.
@bartekn
Copy link
Contributor

bartekn commented Jan 9, 2020

Closed in #2096.

@bartekn bartekn closed this as completed Jan 9, 2020
bartekn added a commit that referenced this issue Jan 9, 2020
…version <10 ledgers (#2099)

This commit adds a code that checks if tx meta version is v2 for
protocol version <10 ledgers.

As explained by @MonsieurNicolas in #1902:

> There is some missing meta in protocol version older than version 10.
This impacts transactions with one time signers (that get removed after
operations in v9 and earlier; and during signature verification in v10
and later). Those changes are invisible in the meta which may confuse
certain ingestion processors that keep track of signers on accounts.

It's possible that users will use stellar-core without
`SUPPORTED_META_VERSION=2` and in such case ingestion system can process
state changes incorrectly.
bartekn added a commit that referenced this issue Jan 10, 2020
This commit removes support for ingesting `TransactionMeta.V=0` in
`io.LedgerTransaction.GetChanges`.

The code generating V0 meta was changed in stellar-core but without
upgrading the V param. Some V0 meta has only one `LEDGER_ENTRY_STATE`
emitted only when a ledger entry is first modified in a ledger but
others add it before every `LEDGER_ENTRY_UPDATE` and
`LEDGER_ENTRY_REMOVED`. It looks like the code to parse meta to support
both cases should be possible but since transaction meta in protocol
version <10 can be incomplete (see [1]) users still need to switch to
V2 to be able to parse it.

[1] #1902
[2] stellar/stellar-core#944
[3] stellar/stellar-core#1441
bartekn added a commit that referenced this issue Jan 15, 2020
This commit adds support for ingesting `TransactionMeta` when `V=2` and
updates XDR files.

As explained by @MonsieurNicolas in #1902.

> There is some missing meta in protocol version older than version 10.
This impacts transactions with one time signers (that get removed after
operations in v9 and earlier; and during signature verification in v10
and later). Those changes are invisible in the meta which may confuse
certain ingestion processors that keep track of signers on accounts.
overcat added a commit to StellarCN/py-stellar-base that referenced this issue Feb 7, 2020
Horizon v1.0.0 Compatibility.

#### Added

- Add support for top-level offers endpoint with `seller`, `selling`, and `buying` filter.
  Horizon 1.0 includes a new `/offers` end-point, which allows you to list all offers, supporting filtering by `seller`, `selling`, or `buying` asset.

  You can fetch data from this endpoint by doing `server.offers()` and use any of the following filters:

  - `seller`: `server.offers().for_seller(account_id)`
  - `buying`: `server.offers().for_buying(asset)`
  - `selling`: `server.offers().for_selling(asset)`
  - `offer detail` : `server.offers().offer(offer_id)`

  This introduced a breaking change since it modified the signature for the function `server.offers()`.

  Before, if you wanted to list all the offers for a given account, you'd do:

  ```
  server.offers(account_id)
  ```

  Starting on this version you'll need to do:

  ```
  server.offers().for_seller(account_id)
  ```

  You can do now things that were not possible before, like finding
  all offers for an account filtering by the selling or buying asset

  ```
  server.offers().for_seller(account_id).for_buying(buying_asset).for_selling(selling_asset)
  ```

- Add support for filtering accounts by `signer` or `asset`, this has been released in a previous patch version.
  Horizon 1.0 includes a new `/accounts` end-point, which allows you to list all accounts who have another account as a signer or hold a given asset.

  You can fetch data from this endpoint by doing `server.accounts()` and use any of the following filters:

  - `acount detail`: `server.accounts().account_id(account_id)`, returns a single account.
  - `for signer`: `server.accounts().for_signer(account_id)`, returns accounts where `account_id` is a signer.
  - `for asset`: `server.accounts().for_asset(asset)`, returns accounts which hold the `asset`.

#### Changed

- Regenerate the XDR definitions to include [MetaV2](https://github.com/jonjove/stellar-core/blob/b299b3a458a15f592352c67d4da69baa6e8fbb6a/src/xdr/Stellar-ledger.x#L309) support (also see [#1902](stellar/go#1902)).

#### Fixed

- Fixed some documentation errors.

#### Breaking

- Change function signature for `server.offers`.
  The signature for the function `server.offers()` was changed to bring suppport for other filters.

  Before, if you wanted to list all the offers for a given account, you'd do:

  ```
  server.offers(account_id)
  ```

  Starting on this version you'll need to do:

  ```
  server.offers().for_seller(account_id)
  ```

* `server.accounts().signer` and `server.accounts().asset` are marked as deprecated, use `server.accounts().for_signer` and `server.accounts().for_asset` instead.

There are also some changes related to the horizon's response, currently SDK has not added parse support to it,
so please refer to this [issue](#257) or
release notes of Stellar horizon 1.0.0. In addition, support for parsing the
horizon's responses will be added in the next major update.
overcat added a commit to StellarCN/py-stellar-base that referenced this issue Feb 7, 2020
Horizon v1.0.0 Compatibility.

#### Added

- Add support for top-level offers endpoint with `seller`, `selling`, and `buying` filter.
  Horizon 1.0 includes a new `/offers` end-point, which allows you to list all offers, supporting filtering by `seller`, `selling`, or `buying` asset.

  You can fetch data from this endpoint by doing `server.offers()` and use any of the following filters:

  - `seller`: `server.offers().for_seller(account_id)`
  - `buying`: `server.offers().for_buying(asset)`
  - `selling`: `server.offers().for_selling(asset)`
  - `offer detail` : `server.offers().offer(offer_id)`

  This introduced a breaking change since it modified the signature for the function `server.offers()`.

  Before, if you wanted to list all the offers for a given account, you'd do:

  ```
  server.offers(account_id)
  ```

  Starting on this version you'll need to do:

  ```
  server.offers().for_seller(account_id)
  ```

  You can do now things that were not possible before, like finding
  all offers for an account filtering by the selling or buying asset

  ```
  server.offers().for_seller(account_id).for_buying(buying_asset).for_selling(selling_asset)
  ```

- Add support for filtering accounts by `signer` or `asset`, this has been released in a previous patch version.
  Horizon 1.0 includes a new `/accounts` end-point, which allows you to list all accounts who have another account as a signer or hold a given asset.

  You can fetch data from this endpoint by doing `server.accounts()` and use any of the following filters:

  - `acount detail`: `server.accounts().account_id(account_id)`, returns a single account.
  - `for signer`: `server.accounts().for_signer(account_id)`, returns accounts where `account_id` is a signer.
  - `for asset`: `server.accounts().for_asset(asset)`, returns accounts which hold the `asset`.

#### Changed

- Regenerate the XDR definitions to include [MetaV2](https://github.com/jonjove/stellar-core/blob/b299b3a458a15f592352c67d4da69baa6e8fbb6a/src/xdr/Stellar-ledger.x#L309) support (also see [#1902](stellar/go#1902)).

#### Fixed

- Fixed some documentation errors.

#### Breaking

- Change function signature for `server.offers`.
  The signature for the function `server.offers()` was changed to bring support for other filters.

  Before, if you wanted to list all the offers for a given account, you'd do:

  ```
  server.offers(account_id)
  ```

  Starting on this version you'll need to do:

  ```
  server.offers().for_seller(account_id)
  ```

* `server.accounts().signer` and `server.accounts().asset` are marked as deprecated, use `server.accounts().for_signer` and `server.accounts().for_asset` instead.

There are also some changes related to the horizon's response, currently, SDK has not added parse support to it,
so please refer to this [issue](#257) or release notes of Stellar horizon 1.0.0. In addition, support for parsing the horizon's responses will be added in the next major update.
elliteDanger added a commit to elliteDanger/py-stellar-base that referenced this issue Oct 18, 2024
Horizon v1.0.0 Compatibility.

#### Added

- Add support for top-level offers endpoint with `seller`, `selling`, and `buying` filter.
  Horizon 1.0 includes a new `/offers` end-point, which allows you to list all offers, supporting filtering by `seller`, `selling`, or `buying` asset.

  You can fetch data from this endpoint by doing `server.offers()` and use any of the following filters:

  - `seller`: `server.offers().for_seller(account_id)`
  - `buying`: `server.offers().for_buying(asset)`
  - `selling`: `server.offers().for_selling(asset)`
  - `offer detail` : `server.offers().offer(offer_id)`

  This introduced a breaking change since it modified the signature for the function `server.offers()`.

  Before, if you wanted to list all the offers for a given account, you'd do:

  ```
  server.offers(account_id)
  ```

  Starting on this version you'll need to do:

  ```
  server.offers().for_seller(account_id)
  ```

  You can do now things that were not possible before, like finding
  all offers for an account filtering by the selling or buying asset

  ```
  server.offers().for_seller(account_id).for_buying(buying_asset).for_selling(selling_asset)
  ```

- Add support for filtering accounts by `signer` or `asset`, this has been released in a previous patch version.
  Horizon 1.0 includes a new `/accounts` end-point, which allows you to list all accounts who have another account as a signer or hold a given asset.

  You can fetch data from this endpoint by doing `server.accounts()` and use any of the following filters:

  - `acount detail`: `server.accounts().account_id(account_id)`, returns a single account.
  - `for signer`: `server.accounts().for_signer(account_id)`, returns accounts where `account_id` is a signer.
  - `for asset`: `server.accounts().for_asset(asset)`, returns accounts which hold the `asset`.

#### Changed

- Regenerate the XDR definitions to include [MetaV2](https://github.com/jonjove/stellar-core/blob/b299b3a458a15f592352c67d4da69baa6e8fbb6a/src/xdr/Stellar-ledger.x#L309) support (also see [#1902](stellar/go#1902)).

#### Fixed

- Fixed some documentation errors.

#### Breaking

- Change function signature for `server.offers`.
  The signature for the function `server.offers()` was changed to bring support for other filters.

  Before, if you wanted to list all the offers for a given account, you'd do:

  ```
  server.offers(account_id)
  ```

  Starting on this version you'll need to do:

  ```
  server.offers().for_seller(account_id)
  ```

* `server.accounts().signer` and `server.accounts().asset` are marked as deprecated, use `server.accounts().for_signer` and `server.accounts().for_asset` instead.

There are also some changes related to the horizon's response, currently, SDK has not added parse support to it,
so please refer to this [issue](StellarCN/py-stellar-base#257) or release notes of Stellar horizon 1.0.0. In addition, support for parsing the horizon's responses will be added in the next major update.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
horizon ingest New ingestion system
Projects
None yet
Development

No branches or pull requests

3 participants