-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: integrate rocksdb to persist btc payments #246
base: master
Are you sure you want to change the base?
Conversation
I am not sure this is true, if we use the transaction creation mutex correctly. Anyway, my main problem with this approach is atomicity - sending the transaction and writing to the database needs to be one atomic action, which it is not. If the program stops executing after submitting the transaction but before the database write, you will end up making the transaction again at startup. |
As discussed, the way forward here is probably to store the raw transaction in the database prior to sending them out. Then at startup, you can just resend any transactions still in the database. With this approach we do need to be careful with our transaction creation mutex. If there is a raw transaction in the database at startup, we must send them to the bitcoin chain prior to creating new transactions, since otherwise bitcoin core can try to spend the same uxto twice. |
Signed-off-by: Gregory Hill <[email protected]>
Signed-off-by: Gregory Hill <[email protected]>
Signed-off-by: Gregory Hill <[email protected]>
Signed-off-by: Gregory Hill <[email protected]>
Signed-off-by: Gregory Hill [email protected]
My reasoning is that we cannot trust that the BTC payment for a parachain request will definitely be in the mempool - if not already included in a block. We could use the
listtransactions
Bitcoin RPC to check what transactions our node has made but it is far easier to maintain a simple KV lookup for request ID to TxId.TODO