Skip to content
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

Check status of staking/unbonding transactions with every new btc block #57

Open
KonradStaniec opened this issue Sep 28, 2023 · 0 comments

Comments

@KonradStaniec
Copy link
Collaborator

Currently staker program tracks state of managed transactions only in important points of their lifecycle.

This can lead to local view of state of transaction diverging from the state which transaction really have on btc chain. Examples:

  • if staking transaction was send and confirmed on btc chain but later its timelock would expire, and staker would spend transaction using different means than staker program, then staker program would not know about it
  • if transaction is slashed, and slashing transaction is send to btc, staker program does not know about it

This can lead to confusion on behalf of the user.

Potential solutions:

  • built in wallet - wallet usually have already implemented logic which handles new incoming blocks. We cold use https://github.com/lightningnetwork/lnd/tree/master/lnwallet or btcdwallet. Of course this is big piece of code to integrate
  • better usage of rpc api exposed by wallet - api exposed by bitcoind https://developer.bitcoin.org/reference/rpc/ is pretty complete, and it would be possible to do most logic by wallet. Problem is, most of those methods are not implemented by btcdwallet, or are not exposed by rpcclient provided by btcd, so we would need to probably ditch btcdwallet support and add missing methods to rpc client.
  • some how grown solution - with each incoming blocks check status of our request on btc chain and adjust state of our staking request accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant