-
Notifications
You must be signed in to change notification settings - Fork 499
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
Extend the Change structure in the ledger_change_reader to include the operation that prompted the ledger entry change #5535
Comments
➕ this would be immediately beneficial for Hubble. We are creating a
Would it make sense to also include the transaction id or transaction hash on the Change struct? While there is no operation that makes the change, there is a transaction that is associated with the change. For any type of change, regardless if an operation caused it, I think it's useful to also include a way to tie back to transaction id. |
@sydneynotthecity - yes, this is a fair ask and one that is easily done. |
Does this change also include updates to the change compactor then? Edit: PR shows added LedgerCloseMeta and LedgerTransaction which takes care of ledger sequence |
The semantic of reading changes does not work with the change compactor. I mention that in the comments over the Change struct Tl;dr - if you want to get change information at this kind of grass root level, you should not be using the ChangeCompactor. Something like
|
Re
If an entry undergoes multiple changes as a part of one or more operations within a transaction OR as a part of one or more transactions in a ledger, the change compactor simply spews a single Unless you meant something else? |
NVM the change compactor accepts changes. It is up to the user to decide what changes to pass to the compactor |
A
Change
struct as represented here indicates that a ledger entry has changed.A ledger entry can be changed because of a transaction or because of an operation.
Every successful operation will cause one or more ledger change entries.
For e.g a path payment operation will, at a minimum, will cause a ledger change entry for source account entry and destination account, vis-a-vis account balances. The same path payment operation can also cause one or more offers to be partially filled in the order book or take some liquidity of the liquidity pool.
So, in the
operationMeta
for a successful path payment operation, there will be ledger entry changes corresponding to - source account, destination account, offers that might have been touched by the operation, liqudity pool changes.It is a useful construct to be able to tie "what caused this change" to the ledger change entry.
This task deals with extending the Change struct to include additional fields to indicate what operation, if any, caused this change
Note that not all changes are caused by operations.
For e.g a change can be caused by a transaction - for e.g The fees for all the operations in a transaction will be debited from the source account of the transaction. So, the
Change
struct that captures account balance changes for the soure account of the transaction, will not have any details about operation.The text was updated successfully, but these errors were encountered: