-
Notifications
You must be signed in to change notification settings - Fork 40
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
Record Reorgs in the database #36
Comments
When we do this we should remove the twilio integration. Per @kauffj "Chainquery should just be a utility to extract blockchain data into SQL or other more usable formats." This sort of notification should leverage Chainquery not be part of Chainquery. We have twilio integration for internal-apis and should implement the notification there. |
@kauffj I thought of a concern with this. Since reorgs happen and go away. There could be a data consistency issue between instances of Chainquery depending on when they were started up and if there was any downtime. 2 instances of Chainquery could have data inconsistencies depending on the variables mentioned. This makes the data unreliable. Is this a concern for you too or should this be ignored as long the DB data is not used in logic. |
That's a very smart point that now makes me a bit ambivalent about this. It does seem like all chainquery installs should create identical states. Though if we think of re-orgs as equivalent to a logging event maybe it's fine. Any comments @lyoshenka ? |
i think its fine to log them in a separate table that's just used for this logging purpose |
dupe of #48 ? |
No, this issue is for recording the reorg information in the db. |
When a reorg happens, it is detected by Chainquery and handled such that Chainquery stays at the top of the chain. However, the current state is just that a reorg notification is only logged and not recorded.
We should create a table called
reorgs
. It should have columns:id
,depth
,created_at
,height
,block_hash_list
. Theblock_hash_list
should be a json string array of the hashes of the blocks that were removed due to the reorg. This will help investigating after the fact.Below is where reorgs are checked for and handled.
https://github.com/lbryio/chainquery/blob/master/daemon/processing/block.go#L128-L165
Acceptance Criteria
Definition of Done
The text was updated successfully, but these errors were encountered: