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

watch_staking endpoint accepts unsent transaction #50

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

watch_staking endpoint accepts unsent transaction #50

KonradStaniec opened this issue Sep 18, 2023 · 0 comments

Comments

@KonradStaniec
Copy link
Collaborator

Currently watch_staking endpoint (https://github.com/babylonchain/btc-staker/blob/main/stakerservice/service.go#L434) will hapilly accepts staking transactions which weren't sent to btc by the caller. This can lead to possiblity of dosing staker program.

There are few possiblities to fix it:

  • we can have timeout for waiting for confirmations i.e if we not receive 1st confirmation in 30min, we cancel whole thing
  • we can have staker, first to check its node mempool for the staking tx, and if its not there in like 5min from receving staking request then, cancel whole thing
    -we can require staker to send valid staking tx (i.e signed and ready to be send to btc) and just send it by itself. Then if tx is already in staker btc node mempool we just declare everything is correct, and if not it will just speed up staking tx propagation through the network as it will propagate from staker node and from whatever the wallet sent it.

Drawbacks of every of this solution is that we start relaying on btc node attached to staler program, which can lead to rejecting some staking requests if btc node is not synced or lost data.

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