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

There is a fee error somewhere #200

Open
bonomat opened this issue Jul 30, 2021 · 2 comments
Open

There is a fee error somewhere #200

bonomat opened this issue Jul 30, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@bonomat
Copy link
Member

bonomat commented Jul 30, 2021

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 bonomat added the bug Something isn't working label Jul 30, 2021
@bonomat
Copy link
Member Author

bonomat commented Aug 2, 2021

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
Copy link
Member Author

bonomat commented Aug 3, 2021

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

waves/bobtimus/src/lib.rs

Lines 132 to 135 in f366dd9

let bob_inputs = elements_client
.select_inputs_for(asset_id, input_amount, false)
.await
.context("failed to select inputs for swap")?;

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant