-
Notifications
You must be signed in to change notification settings - Fork 506
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 |
This squash commit is the sum total of all the commits for this github issue - #5535 TL;dr Extend the ingest.Change struct to include information about the reason for the state change in the ledgerEntry. * Include operation information in the Change struct * Dont error out when operation index out of range * Fix failing unit test * Reafactor ledger_transaction.GetChanges() to use internal functions * reformat comments * Add all types of change reasons to the Change struct. Simplify LedgerTransaction.GetChanges() * Add LCM and transaction info altogether in change entry * Wrte help doc for Change Entry * Add TxHash to LedgerTransaction struct * reorg comments * Comments cleanup * Address PR review changes * rename fields * uncommit half baked changes * Add helpers in intergration tests for creating captive core config * fix updates to change struct * Updates to integration.go * Integration tests for change - part 1 * Undo all changes to parameters_test.go * Make updates to comments and rename variables * - Several changes to integration.go to pull out common functions from parameters_test.go to configure captive core - Add flags to capture state for upgrade version in test. - Add support to skip container deletion for debugging - Add test for upgrade related changes * cosmetic doc style changes * check err before file close * Add tx test and in change_test.go * code cleanup * Rework test fixtures * reformat file * Fix breaking test * Address code review comments
confirmed this is done-done in standup. |
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: