Closed ShookLyngs closed 4 months ago
The test seems to need fixing, consider switching to our paid mempool.space api
The test seems to need fixing, consider switching to our paid mempool.space api
Yes, I was waiting for the update of btc-assets-api: https://github.com/ckb-cell/btc-assets-api/pull/96. Do you think I should quit waiting and just switch to the paid api ASAP? My concern was that it wouldn't help much, as I've tested with the paid api but the 503 error still occurs from time to time.
The test seems to need fixing, consider switching to our paid mempool.space api
Yes, I was waiting for the update of btc-assets-api: ckb-cell/btc-assets-api#96. Do you think I should switch to the paid api instead of waiting? I've tested with the paid api and it help just a little, the 503 error still occurs from time to time.
When encountering a 503 error, can it be avoided by retrying a few times?
When encountering a 503 error, can it be avoided by retrying a few times?
Yes, adding retry mechanism to the BtcAssetsApi is also a solution.
Changes
Details
Currently, the logic of
needPaymasterOutput
is simple:As you can see, we're comparing the length of inputs and outputs to see if the CKB virtual transaction needs a paymaster cell. It's a solid solution and can work without issues in most cases. However, in some rare cases, the information can be inaccurate.
For example, if the following conditions are met:
Right now we don't have to worry about those rare cases, but in the future if needed, we can improve the check statement by comparing the capacity sum of the inputs and outputs of the CKB_VTX, instead of comparing their lengths. For that, we need to query each input's corresponding Live Cell (because inputs are OutPoints that don't contain the
capacity
property):