pow-co / pow.co

https://powco.vercel.app
7 stars 7 forks source link

Some boosts not (?) going through to API #170

Open usselman opened 1 year ago

usselman commented 1 year ago

It appears that some boosts are not going through to the API, despite not giving an ERROR.

For example, this post: https://whatsonchain.com/tx/49b7e70de28f787e09e3de364d4c4177d40f089fd645e2cec72ca49d7b179db3 I boosted into the tag 1owenkellogg a few days ago and I don't think it has gone through.

This post as well: https://pow.co/072633cc05e48a99aa8cf4b6dcfcbd020b923b1bd480c9b827a028aec7df5575 I boosted into several tags but appears to have 0 difficulty mined, 16 days later.

owenkellogg commented 1 year ago

My hypothesis is that there is a race condition when submitting jobs via txid where we fetch the transaction from whatsonchain by txid but it does not exist therefore gives a 404 error, and rather than returning an error to the user it simply returns an empty array [].

One reasonable solution is to have pow.co submit the entire serialized transaction hex to boostpow-api and have boostpow-api broadcast the transaction. I think we might have done this but there was another race condition where if the transaction had already been seen by whatsonchain then a 400 error was returned "tx already in mempool". In that case we should still import the job rather than returning an error, but I think we were not handling that 400 response correctly and instead returned an error.