waves icon indicating copy to clipboard operation
waves copied to clipboard

There is a fee error somewhere

Open bonomat opened this issue 4 years ago • 2 comments
trafficstars

Random error recorded:

  1. Borrower took a loan
  2. Signing worked
  3. Sent to Bobtimus
  4. Bobtimus failed
2021-07-30T00:12:20.032501Z  INFO Server::run{addr=127.0.0.1:3030}: warp::server: listening on http://127.0.0.1:3030
2021-07-30T05:10:36.390841Z ERROR bobtimus::problem: unhandled error: JSON-RPC request failed with code -26: insufficient fee, rejecting replacement 2e3a4d00a38e57612d0ab06124ad5a04666110264b669780f6a0c1812976d7f6; new feerate 0.00001004 BTC/kB <= old feerate 0.00001004 BTC/kB (code 66): JSON-RPC request failed with code -26: insufficient fee, rejecting replacement 2e3a4d00a38e57612d0ab06124ad5a04666110264b669780f6a0c1812976d7f6; new feerate 0.00001004 BTC/kB <= old feerate 0.00001004 BTC/kB (code 66)
  1. Borrower thinks the loan is active.

Loan values.

image

bonomat avatar Jul 30 '21 05:07 bonomat

This issue stems from bobtimus trying to double spend himself:

How to reproduce:

  • take 1 loan (don't repay)
  • take another loan

the second loan creation might fail. If not, keep taking loans :D Eventually bobtimus runs out of utxo's and will double spend a transaction. This fails with the error:

new feerate 0.00001004 BTC/kB <= old feerate 0.00001004 BTC/kB

Meaning, it assumes a replace by fee but since we use the same fee again the second transaction fails.

bonomat avatar Aug 02 '21 04:08 bonomat

Issue on Bobtimus side is that we do not lock selected utxos:

https://github.com/comit-network/waves/blob/f366dd9a8dd782d064aca2bcbc32f7b4fbcfa162/bobtimus/src/lib.rs#L132-L135

So this might be an easy fix. Besides that, we should nevertheless report an error to the caller if publishing failed.

bonomat avatar Aug 03 '21 02:08 bonomat