-
Notifications
You must be signed in to change notification settings - Fork 501
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: account operations endpoint does not include all operations affecting the account #5538
Comments
The specific query that spawned this conversation is used in Freighter here and is
|
It seems that it was designed this way. In the operations processor, for The following query is used by I don't have more context on why it was designed this way but @tamirms and @2opremio can provide more insight. |
This is an oversight in the participants extraction logic. For other operations it is possible to determine the participants from the operation itself (for example, a payment operation contains both the sender and the recipient). However, it is not possible to determine participants for an invoke host operation by looking solely at the smart contract invocation. The code assumes that the only participant is the account performing the invoke host operation but that assumption is false. A better way to determine participants for an invoke host operation is to use GetOperationChanges() to get all ledger entry changes which occurred as a side effect from executing the operation. We can then infer the participants by extracting the account ids from any accounts and trustlines included in the list of ledger entry changes. I suspect this method is not perfect because there could be some corner cases where a participant is not present in the ledger entry changes. For example, if a smart contract invocation results in account A sending XLM to some destination and also account A receiving an equal amount of XLM. In this scenario, there is no change in the state of the account A ledger entry because it received an amount equal to what it sent and therefore account A will be missing from the ledger entry changes. Perhaps we can also look a the SAC events to extract any additional participants that are not present in the ledger entry changes. Unfortunately, when we fix this issue we will need to reingest history to correct the missing data in the Horizon DB. |
What version are you using?
22.0.1-dd8a9b473a303cfcdd383d1db45dace93ea0861c
What did you do?
Go to:
https://horizon.stellar.org/accounts/GDZAGXA74ZE2B54TYUXNUAOY3MTDL3ECP4EPYTRO3TKKKBRZF265UERA/operations?order=desc
Go to:
https://horizon.stellar.org/accounts/GDZAGXA74ZE2B54TYUXNUAOY3MTDL3ECP4EPYTRO3TKKKBRZF265UERA/effects?order=desc
What did you expect to see?
I expected to see present an operation and effects relating to:
https://horizon.stellar.org/operations/234143333304045569
The operation affects the GDZA account because a transfer is made to the account during the operation.
I expected this because the account operations endpoint shows payments from other source accounts that affect the GDZA account.
What did you see instead?
The operation is seen in the /effects endpoint, but not the /operations endpoint.
Related conversion: https://stellarfoundation.slack.com/archives/C03347FNAHK/p1732298224113449
cc @tomerweller
The text was updated successfully, but these errors were encountered: