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

InsufficientFeeAmount on test accounts. #1361

Open
Oleksii-Kshenskyi opened this issue May 6, 2024 · 7 comments
Open

InsufficientFeeAmount on test accounts. #1361

Oleksii-Kshenskyi opened this issue May 6, 2024 · 7 comments
Assignees

Comments

@Oleksii-Kshenskyi
Copy link

Oleksii-Kshenskyi commented May 6, 2024

Hi! So when writing a Rust order matcher with the fuels crate, all my test accounts eventually become unusable with this error message:
[15:11:51][ERROR] An error occurred while matching: IO error: Response errors; Validity(InsufficientFeeAmount { expected: 326087, provided: 323226 })

I'm sorry I cannot provide a specific scenario to reproduce, but it would usually go like this:

  1. I create a new wallet with Fuelet Wallet (Chrome)
  2. I take test Ether from the faucet
  3. I start testing the matcher: creating test orders, matching them, then creating more etc.
  4. Eventually at some point, all blockchain operations with this wallet start erroring out with the error above, with no way to fix it
  5. I create a new account, get some test Ether and start testing the matcher: all is good again and the problem disappears.
  6. At some point, the problem starts happening on the new wallet too and everything repeats again.

I unfortunately don't know of an easier or more reliable way to reproduce this. The only way is, I have a wallet and a private key for which this problem already exists. If needed, I can give it to you: it's a test account, so it's of no importance.

P.S. This is using the fuels crate version 0.55.1 on Manjaro Linux, on Beta 5 (related to my comment in #1342, it's the same issue)

@MujkicA
Copy link
Contributor

MujkicA commented May 10, 2024

Hi, thanks for informing us of this issue.

Since you are testing on beta-5, would you be able to share the relevant wallet address and/or transaction id so that we have some more insight into what is happening here?

@MujkicA MujkicA self-assigned this May 10, 2024
@Oleksii-Kshenskyi
Copy link
Author

Hi, thanks for informing us of this issue.

Since you are testing on beta-5, would you be able to share the relevant wallet address and/or transaction id so that we have some more insight into what is happening here?

Hi, thanks for the response! Unfortunately, I can't provide the transaction ID, because the transaction's Result returns Error, and the tx_id is in the Ok type (FuelCallResponse)... But I can provide the wallet address, and the "good" part here is that I think almost any transaction on that wallet should return this error, so this should be easy to reproduce.

Here's the wallet address: fuel1aeh0ruymh5j9syvldjm7zxsf2v2tua7pm2fn9hd9vn9ps5gw9txs9m4ngc.
Let me know if I can provide anything else, and thanks for the help!

@chlenc
Copy link

chlenc commented May 21, 2024

git clone git@github.com:compolabs/spark-matcher-rs.git   
cd spark-matcher-rs
echo «env data» >> .env    
cargo run

.env file

NODE_ENV=development
PORT=5003

PRIVATE_KEY="0x7e07fb62e6db3bddb766c6ef21fc622f1ff93d8b4d7ee7b7e1c8c25a15dbadaf"

CONTRACT_ID="0x0f0c1065a7b82d026069c5cf070b21ee65713fd1ac92ec1d25eacc3100187f78"

INDEXER_URL="https://indexer.spark-defi.com"
FETCH_ORDER_LIMIT=100

MARKET="BTC"

LOG_FILE="matcher.log"
FILE_LOG_LEVEL="debug"
CONSOLE_LOG_LEVEL="info"

MAX_FAIL_COUNT=3

@Oleksii-Kshenskyi
Copy link
Author

Oleksii-Kshenskyi commented May 22, 2024

@MujkicA @hal3e Guys, I've tried the suggested workaround for estimating transaction cost and bumping it by ~20%, but unfortunately the InsufficientFeeAmount pops up even for the estimate_transaction_cost() itself. So I need the estimation, but the estimation itself triggers the issue. What can I do in this case?
bork

Here, I get the Err while unwrapping on line 257.

@MujkicA
Copy link
Contributor

MujkicA commented May 22, 2024

You can try using the wallets entire base asset balance as temporary workaround

let wallet = Wallet::from_address(addr, Some(provider.clone()));
let balance = provider.get_asset_balance(wallet.address(), BASE_ASSET_ID).await?;
call_handler.add_custom_asset(BASE_ASSET_ID, balance, None);

@Oleksii-Kshenskyi
Copy link
Author

We (me and @MujkicA) have found a solid workaround for this issue, so thanks so much for all the help! Won't be closing the issue until the official fix for this is out. Thank you guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants