Giveth / giveth-dapp

Giveth Dapp for crowdfunding and managing donations on the ethereum blockchain.
https://beta.giveth.io
GNU General Public License v3.0
358 stars 230 forks source link

Errors delegating to Traces #2556

Open Danibelle opened 2 years ago

Danibelle commented 2 years ago

Receiving errors when delegating funds to Traces - this one on paying Amins Trace on Giveth 2 Campaign.

Issue type: Error Unable to update the donation in feathers

Name: Error

LineNumber: undefined

FileName: undefined

Stack "NotAuthenticated: Error\n at new c (https://d33wubrfki0l68.cloudfront.net/bundles/0a08adf3c01a13e5279cc943c2ec2023df978ba3.js:2:2531672)\n at convert (https://d33wubrfki0l68.cloudfront.net/bundles/0a08adf3c01a13e5279cc943c2ec2023df978ba3.js:2:2533700)\n at p. (https://d33wubrfki0l68.cloudfront.net/bundles/0a08adf3c01a13e5279cc943c2ec2023df978ba3.js:2:2524987)\n at p.onack (https://d33wubrfki0l68.cloudfront.net/bundles/0a08adf3c01a13e5279cc943c2ec2023df978ba3.js:2:1337452)\n at p.onpacket (https://d33wubrfki0l68.cloudfront.net/bundles/0a08adf3c01a13e5279cc943c2ec2023df978ba3.js:2:1336857)\n at p. (https://d33wubrfki0l68.cloudfront.net/bundles/0a08adf3c01a13e5279cc943c2ec2023df978ba3.js:2:1338793)\n at p.r.emit (https://d33wubrfki0l68.cloudfront.net/bundles/0a08adf3c01a13e5279cc943c2ec2023df978ba3.js:2:624669)\n at p.ondecoded (https://d33wubrfki0l68.cloudfront.net/bundles/0a08adf3c01a13e5279cc943c2ec2023df978ba3.js:2:1328330)\n at l. (https://d33wubrfki0l68.cloudfront.net/bundles/0a08adf3c01a13e5279cc943c2ec2023df978ba3.js:2:1338793)\n at l.r.emit (https://d33wubrfki0l68.cloudfront.net/bundles/0a08adf3c01a13e5279cc943c2ec2023df978ba3.js:2:624669)"
Danibelle commented 2 years ago

Popups are stacked on top of the Delegation window, which I then have to close. I don't know if I really got an error, the transaction really went through, if I should just close out the Delegation window or do it again:

image

image

image

Danibelle commented 2 years ago

Sometimes there is a "Transaction Failed" in the stack of errors.. then after I close them all out I get a "Transaction Successful!"

image

MoeNick commented 2 years ago

@RamRamez cam you please investigate?

aminlatifi commented 2 years ago

This issue is somehow complicated. Basically DApp prepares transactions (here delegation) based on pledges data stored in backend. On @Danibelle first delegation, she couldn't send updated data to feathers so the pledges data were obsolete. So next delegation attempt was created based on that obsolete data, that's the reason the smart contract rejected the call since probably the intended pledges had not enough money inside to pay.

No easy fix comes to my mind at this moment, the only working solution I would recommend is that after delegating on project money (Here the campaign), user should wait for about 10 blocks of rinkeby to be mined before next attempt to delegating from the same project.

Danibelle commented 2 years ago

OK Thank you Amin.

I understand this from subsequent delegations - the difference between the first delegation (yours) and subsequent delegations is that there were TWO "Oh No" messages instead of just one.

But the bigger issue is that instantly upon signing the MetaMask transaction - all the errors popped up instantly. An "Oh No".. With a "Transaction Failed" beneath it.. and the Delegation window remained open below it.

Seems like there should be a delay after signing that says WAIT ... and the Delegation Window should either close when I select Delegate, or stay in a waiting stage until the blocks are mined.

Danibelle commented 2 years ago

I do get a 'Transaction Successful' once the blocks are mined.

aminlatifi commented 2 years ago

In DM also @Danibelle mentioned an important clue! The first delegation was not complete! To explain more, a trace needed 1.39 ETH but at the first delegation 1.2 ETH was delegated. So my assumption about obsolete state can not be the reason in this case.