-
Notifications
You must be signed in to change notification settings - Fork 524
services/horizon: Add accounts and account data to ingestion pipeline #1819
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: Add accounts and account data to ingestion pipeline #1819
Conversation
9443a58
to
0cc08d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 -- I think this will be useful too for #442
services/horizon/internal/db2/schema/migrations/23_accounts.sql
Outdated
Show resolved
Hide resolved
services/horizon/internal/db2/schema/migrations/23_accounts.sql
Outdated
Show resolved
Hide resolved
0cc08d3
to
4d144ef
Compare
763547d
to
36dbaff
Compare
TODO state verification fails:
|
Fixed an issue connected to state verification in 19187bc09648b9e3c950c745fc34df6ffeecac9f but this PR is currently blocked by #1836. |
19187bc
to
ab4f473
Compare
ab4f473
to
74d746f
Compare
@@ -73,11 +73,11 @@ func (p *OrderbookProcessor) ProcessLedger(ctx context.Context, store *pipeline. | |||
switch { | |||
case change.Post != nil: | |||
// Created or updated | |||
offer := change.Post.MustOffer() | |||
offer := change.Post.Data.MustOffer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bartekn why did we have to change to .Post.Data
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I forgot to mention this. It's because I changed /exp/ingest/io.Change
:
type Change struct {
Type xdr.LedgerEntryType
- Pre *xdr.LedgerEntryData
+ Pre *xdr.LedgerEntry
- Post *xdr.LedgerEntryData
+ Post *xdr.LedgerEntry
}
LedgerEntry
is LedgerEntryData
plus LastModifiedLedgerSeq
. I had to do this because stellar-core sometimes generates a change in metas even though ledger entry actually doesn't change (ex. core loads an entry to update the XLM balance but it doesn't change because amount sold and bought are both zeros due to rounding). You can see this for GAXB325M4CYY5IYFEKOPH5H6LLILECK7Y5RAVTB3THN3LKMGIVDJCICU
in this transaction meta: https://horizon.stellar.org/transactions/f87b374b377ca66d763dafb9ef408726ce28d90b9994fc81ceb767c1a20d2cdb. It's actually going to be changed in stellar-core (CAP-0017) one day.
Without changing this we wouldn't know that we need to update LastModifiedLedgerSeq
in a DB and state verifier would fail (it's actually how I found this issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
-- +migrate Up | ||
|
||
CREATE TABLE accounts ( | ||
account_id character varying(56) NOT NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bartekn oh I missed this, it seems like we have been using accountid
in other places. Not a big issue though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, we should make it consistent: #1858
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
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.
Summary
This commit adds accounts and account data to ingestion pipeline.
Summary of changes
accounts
andaccounts_data
tables.db2/history
package with accounts and data related interfaces and structs.DatabaseProcessor
to process accounts and data in state and ledger pipelines.