You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature - Write bitcoin block data in a SQL transaction
1. Description
We want to make sure that when we write bitcoin block data, either all of it gets written or none of it.
1.1 Context & Purpose
In the event of an error during processing of a bitcoin block, bailing leaves the database in a clean state and reprocessing can happen cleanly. So connectivity issues with bitcoin core or other temporary issues do not disturb the proper processing of the bitcoin block and the transactions within.
2. Technical Details:
This one has been known for some time, but it is quite tricky to tackle because all of our queries get executed atomically. But it's actually not too bad to change.
2.1 Acceptance Criteria:
Processing of a bitcoin block always leaves the database in a "clean" state. So either the entire block is successfully processed or none of it is.
3. Related Issues and Pull Requests (optional):
4. Appendix
I only see one way to make this a seamless update, and that is to make the following three changes:
Change the PgStore type to be an enum, with a sqlx::PgPool variant and a sqlx::Transaction variant.
Add a method to PgStore that returns a &dyn sqlx::Executor or something like that.
Modify some of the functions in the BlockObserver to pass in the PgStore (the sqlx::Transaction variant) when writing to the database.
The text was updated successfully, but these errors were encountered:
Feature - Write bitcoin block data in a SQL transaction
1. Description
We want to make sure that when we write bitcoin block data, either all of it gets written or none of it.
1.1 Context & Purpose
In the event of an error during processing of a bitcoin block, bailing leaves the database in a clean state and reprocessing can happen cleanly. So connectivity issues with bitcoin core or other temporary issues do not disturb the proper processing of the bitcoin block and the transactions within.
2. Technical Details:
This one has been known for some time, but it is quite tricky to tackle because all of our queries get executed atomically. But it's actually not too bad to change.
2.1 Acceptance Criteria:
3. Related Issues and Pull Requests (optional):
4. Appendix
I only see one way to make this a seamless update, and that is to make the following three changes:
PgStore
type to be an enum, with asqlx::PgPool
variant and asqlx::Transaction
variant.PgStore
that returns a&dyn sqlx::Executor
or something like that.BlockObserver
to pass in thePgStore
(thesqlx::Transaction
variant) when writing to the database.The text was updated successfully, but these errors were encountered: