-
Notifications
You must be signed in to change notification settings - Fork 6
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
BTC Staker Improvements #107
Comments
Hi, I am an engineer at B-Harvest. Our team plans to work on this issue, and we are considering proceeding as follows. If there are any issues or alternative suggestions, I'd appreciate it if you could share them. In reality, I didn't change anything, but I first organized the parts that I thought needed to be modified in the overall flow. Delete
|
Note about After removing support for post approval flow, the whole |
This epic describes possible improvements to BTC staker based on most recent developments.
Delete
watch-staking
endpointThe exsiting endpoint watch-staking endpoint was only introduced as hack for the past testnet. It can be deleted. It should simplify database and logic in stakerapp as there are different code paths to handle this request (example: https://github.com/babylonlabs-io/btc-staker/blob/v0.13.0/staker/stakerapp.go#L1502)
Remove
post-approval flow
In the past the only way to stake was:
This flow is currently discouraged.
Currently staker supports both flows: pre-approval and post-approval, due to the fact that it was easier and quicker to add additional flow rather than do fully fledged refactoring. Difference in handling both flows can be tracked from handling staking cmd.
Removal of post-approval flow, should result in simplifications in btc-staker logic. It should also result in possibility of dropping most of the state from btc-staker database.
Reduce amount of state held in Database
Currently btc-staker, holds a lot of state in its database which leads to complex logic when restarting the program.
After removing
post-approval
flow andwatch-staking
endpoint it should be possible to remove most of the state from btc-staker database and relay mostly only Babylon blockchain as some sort of storage for all the data related to staking. In theory, the only thing that btc-staker could store in its local db are staking transactions hashes for initiated staked requests.Track status of each sent staking transaction with each new BTC block
Currently btc-staker tracks the state changes of the sent staking transactions based on the operations initiated from btc-staker. i.e if user would unbond his staker from other place (lets say front end ui) the btc staker would be left with invalid db state. This is less than ideal.
The most comprehensive solution would be:
The text was updated successfully, but these errors were encountered: