-
Notifications
You must be signed in to change notification settings - Fork 513
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
Ingestion: verify updating data against stellar-core #1550
Comments
Given that adding changes to stellar-core may take some time (and we don't have any specific proposal yet), here's a simple algorithm we can implement now. Returns
Memory requirements: depend on the batch size and state reader If an invalid state is detected, Horizon saves a special flag to a database and panics. On startup, if a special flag is set, Horizon refuses to start and prints error about invalid state. |
@bartekn Does the stellar-core http info endpoint provide enough information for this? Doc says
which looks like the ledger hash for ledger number |
Ledger hash is helpful but not for state checking. As far as I remember, it's a hash of transaction set for a given ledger. So we can use this to ensure that set of transactions provided by ledger backend matches the hash in ledger header. |
@bartekn Do you think it'd be adequate if we just surfaced the set of bucket level hashes? Or do you want a fine-grained set of hashes of each value in your database? (am I understanding the plan correctly, that you want to hash every row in your database?) |
@graydon this is correct and I actually have a prototype in |
This commit adds a new job and nightly workflow to compare state ingested using `SingleLedgerStateReader` with an actual state in Stellar-Core DB. In #1550 we are building a tool to periodically compare state in Horizon DB vs state in history archives. This way we can find if the state updated using txmeta is the same as in buckets for a given checkpoint. However, in case there is a bug in `SingleLedgerStateReader` the check may succeed even though the state is actually invalid. We have good tests for `SingleLedgerStateReader` but it's always better to be safe than sorry.
The algorithm above depends on |
Closed in #1691. |
To gain confidence in the new ingestion system, and for sanity checking in production, every few ledgers we should verify the hash of the current ingested ledger, and compare it to the equivalent hash of stellar-core's data.
Although we could if necessary do this by direct DB access in the short-term, to implement this well we need to plan with core team the best way for stellar-core to expose the hash for Horizon to consume.
The text was updated successfully, but these errors were encountered: