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

Storage market's provider state thinks clientMarketBalance.Available is too small when client wallet has enough balance #4149

Closed
jennijuju opened this issue Oct 3, 2020 · 5 comments · Fixed by #4273
Labels
area/markets Area: Markets

Comments

@jennijuju
Copy link
Member

This is triggered in https://github.com/filecoin-project/go-fil-markets/blob/b01daa81e44e1d71b6a38c265065341eb766554f/storagemarket/impl/providerstates/provider_states.go#L154.

Screen Shot 2020-10-02 at 8 42 23 PM

The last one is showing me a storage deal error b/c of clientMarketBalance.Available too small when the total price is 0.000524194 FIL, but my wallet balance is 504.993990698330930181 FIL

@arajasek mentioned that he may be reproduce the issue.

Suspicion is that: When we check the client balance before miner accept the deal, we are getting the wrong client balance. Further analysis required.

@jennijuju jennijuju added need/analysis Hint: Needs Analysis area/markets Area: Markets labels Oct 3, 2020
@arajasek
Copy link
Contributor

arajasek commented Oct 5, 2020

@ribasushi Has a machine that reproduces this on the client side. Would be good to know whether the client actually has enough available market balance

@pooja
Copy link
Contributor

pooja commented Oct 7, 2020

The screenshot in the issue was taken from my machine, and I can confirm that there was actually enough available market balance (I had 500+ FIL). I was eventually able to get the deal through with ribasushi's help, but the only way I could do that was by creating a new address, funding that new address, and then proposing the deal from the new address.

cc @ribasushi

@ingar
Copy link
Contributor

ingar commented Oct 7, 2020

This might not be related, but the price listed in client list-deals does not include the client collateral, but the rejection criteria in the Provider adds the client collateral to the storage price and compares that to available balance. I'll see if I can add the client collateral in the UX changes I'm making.

@jennijuju
Copy link
Member Author

jennijuju commented Oct 8, 2020

to reproduce the issue.

Default wallet and balance:

Jennifer@jennijuju-3.local:~/filecoin/lotusl wallet default
t1t22rlwvbmjt7hewcm25lur7eyj2urkjx32dwcqi
Jennifer@jennijuju-3.local:~/filecoin/lotusl wallet balance t1t22rlwvbmjt7hewcm25lur7eyj2urkjx32dwcqi
10000000 FIL

Make a deal with price more than it has

Jennifer@jennijuju-3.local:~/filecoin/lotuslc deal bafkqaxlunbuxgidjomqgozdinf2xgylhmzvhgzlhmzrxk23zmvtxg5lgozvsa43fm4nvwmj3gjcbwwzrhmzeig23ge5tera3lmytwmsednnug23hozugs43lo5zwkztupfugs53mgmfdu4labifgk6djoqfa t01000 10000 518400
bafyreico7xiy2ejand3pxeh2pmqsamcz4tzep2d4xzx3rmeg5ydgoisra4
Jennifer@jennijuju-3.local:~/filecoin/lotuslc list-deals
DealCid      DealId  Provider  State             On Chain?  Slashed?  PieceCID     Size   Price           Duration
...dgoisra4  0       t01000    StorageDealError  N          N         ...b4kkbmhq  508 B  5209950000 FIL  520995
  Message: adding market funds failed: GasEstimateMessageGas error: estimating gas used: message execution failed: exit SysErrInsufficientFunds(6), reason: failed to transfer funds (RetCode=6): transfer failed when deducting funds (5209950000 FIL): not enough funds (RetCode=6)

make a deal with price << balance

Jennifer@jennijuju-3.local:~/filecoin/lotuslc deal bafkqaxlunbuxgidjomqgozdinf2xgylhmzvhgzlhmzrxk23zmvtxg5lgozvsa43fm4nvwmj3gjcbwwzrhmzeig23ge5tera3lmytwmsednnug23hozugs43lo5zwkztupfugs53mgmfdu4labifgk6djoqfa t01000 0.00000001 518400
bafyreig7dm22cddbivx2kpty7kmeuzs2titxnfdddyxmsyi7463ghzaona

...3ghzaona  0       t01000    StorageDealError  N          N         ...b4kkbmhq  508 B  0.00520974 FIL           520974
  Message: unexpected deal status while waiting for data request: 11 (StorageDealFailing). Provider message: deal rejected: clientMarketBalance.Available too small

When a storagemarket.ClientEventEnsureFundsFailed is triggered deals comes after it goes to storagemarket.StorageDealFailing right away.

Seems like the StorageDealEnsureClientFunds is not trigger again)

@jsign
Copy link
Contributor

jsign commented Oct 9, 2020

I've seen the same in some Powergate user.
Wallet t3rvsbv5yj5lil74o33bfn5mjsdlnnogukgqua5cnumtid3kgibqeer2uaipcm57iil2ndzykzq34ebp2xajwq, balance 19.53FIL.
Deal failed:

{
  "DealInfo: ": {
    "ProposalCid": {
      "/": "bafyreiblmhvxruw235sut4gqsflfpuhlmjfd3zdgxjjpamq7nqcmkjkq5u"
    },
    "State": 26,
    "Message": "unexpected deal status while waiting for data request: 11 (StorageDealFailing). Provider message: deal rejected: clientMarketBalance.Available too small",
    "Provider": "f010617",
    "DataRef": null,
    "PieceCID": {
      "/": "baga6ea4seaqnsnaqvyzn2ro56gujsb3jexql2u6fcv2wn2ncum26q6eqywphqci"
    },
    "Size": 4261412864,
    "PricePerEpoch": "400000000000",
    "Duration": 521176,
    "DealID": 0,
    "CreationTime": "2020-10-09T19:30:10.879388149Z",
    "Verified": false
  }
}

@TippyFlitsUK TippyFlitsUK removed the need/analysis Hint: Needs Analysis label Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/markets Area: Markets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants