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

Return nil on tx.call() (was not there few days ago) #239

Closed
TheCodewr opened this issue Feb 11, 2020 · 34 comments
Closed

Return nil on tx.call() (was not there few days ago) #239

TheCodewr opened this issue Feb 11, 2020 · 34 comments
Labels
bug Something isn't working 💸 gitcoin-bounty Earn money by helping with this issue! help wanted Extra attention is needed

Comments

@TheCodewr
Copy link

TheCodewr commented Feb 11, 2020

when using let tokenBalance = try! tx.call()
Xcode returns :

Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a dictionary instead.", underlyingError: nil))

using 'web3swift', '~> 2.1.2'
I tried InfuraRopstenWeb3, InfuraRinkebyWeb3
I tried erc20 get balance and ETH get balance
Do you get the same issue ?
thank you


update from @skywinder:

So I will be ready to assign this bounty for this fix

Requirements to succeed this bounty:

  • add internal code-check for this error: that user uses public node and send explicit warning, about public node limitation and suggestion to use private node.
  • add documentation instruction how to do this
@romanmuzikantov
Copy link

romanmuzikantov commented Feb 12, 2020

I got the same issue, i did not change anything and it was working nicely a few days ago.
I did not yet found any solution, but i'm still looking, let me know if you find anything.

@skywinder
Copy link
Collaborator

skywinder commented Feb 13, 2020

Looks like some changes in Infura protocol.
I will check it.

@iHamzaaK
Copy link

@skywinder Hey. Any update on this?

@skywinder
Copy link
Collaborator

hello, @iHamzaaK . I'm currently busy with other tasks.

btw, worth to mention, we recently found money to support the library from the community. I would be glad to make a bounty for someone, who willing to investigate with this issue.

@skywinder skywinder changed the title New? issue (was not there few days ago) Swift, Return nil on call() Return nil on tx.call() (was not there few days ago) Feb 15, 2020
@skywinder
Copy link
Collaborator

@TheCodewr can you provide full code example to debug it?

@skywinder skywinder added the bug Something isn't working label Feb 15, 2020
@TheCodewr
Copy link
Author

Very simple, I was using this exact code https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md
It was working fine, until not ...

@shamatar
Copy link
Contributor

@TheCodewr It may be an Infura problem similar to this. Try something similar on the local dev node

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.045 ETH (12.69 USD @ $282.09/ETH) attached to it as part of the Matter Labs fund.

@aranhaagency
Copy link
Contributor

I'm investigating, it appears that it is an update to geth-1.9, continuing to look for the best solution, reporting to go-ethereum.

@skywinder
Copy link
Collaborator

thanks, @aranhaagency
please, let me know if you find any details, what cause the problem

@haizhiwen
Copy link

I am using version 2.2 and found this problem when send Eth or sned Erc20 token

@TheCodewr
Copy link
Author

I am using version 2.2 and found this problem when send Eth or sned Erc20 token

2.2 version or what ?

@haizhiwen
Copy link

I am using version 2.2 and found this problem when send Eth or sned Erc20 token

2.2 version or what ?

2.2.1

@aranhaagency
Copy link
Contributor

I did some tests with the infura api and it does not deliver the balance on all requests, not if there is a similar service on the mainet I am researching.

I thought of a solution, if infura answer is null, our api hits the xxXx service which will have a new answer with the correct balance. If there are 3 services we can make a switch case.

that's an idea, I accept suggestions on that too.

@aranhaagency
Copy link
Contributor

update on other issue: ethereum/go-ethereum#20685

@aranhaagency
Copy link
Contributor

aranhaagency commented Feb 17, 2020

Can I make a balance call through Alchemy's api? was added to the project by this pull here #193

@shamatar
Copy link
Contributor

You should be able to instantiate a generic JsonRPCProvider using either https or websocket transport and use it with alchemy

@aranhaagency
Copy link
Contributor

Perfect, @shamatar thanks!

@TheCodewr
Copy link
Author

Hi All,
So somehow, using same swift 2.2.1 looks like system is back on game again.
Now I get the balance value using same code and ropsten, or rinkeby
Note that I DID NOT do any change from the date of the disclaim
Have a good one

@aranhaagency
Copy link
Contributor

The problem is on geth old versions @TheCodewr ?

@aranhaagency
Copy link
Contributor

How can we prevent something from breaking our lib, we can make a release system what do you think @skywinder ?

@haizhiwen
Copy link

Version 2.2.1 All other functions are available, except that the transfer fails, send eth or send erc20 token got that error

@TheCodewr
Copy link
Author

TheCodewr commented Feb 19, 2020

aaand the same issue is back again ....
(no environement changes or code changes on my side)

@TheCodewr
Copy link
Author

The problem is on geth old versions @TheCodewr ?

I don't know

@aranhaagency
Copy link
Contributor

Thanks @TheCodewr in all my apoton searches for geth failure, the behavior is normal by alchmyst

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Workers have applied to start work.

These users each claimed they can complete the work by 3 hours from now.
Please review their action plans below:

1) baldyash has applied to start work (Funders only: approve worker | reject worker).

Find what's wrong and fix this issue

Learn more on the Gitcoin Issue Details page.

@TonioMacaronio
Copy link
Collaborator

@TheCodewr hi, could you provide a complete failed case (with addresses)?

Because I've tried it by myself and I am unable to reproduce your problem, also this test passes.

For now, I will close this issue, but feel free to reopen it.

@i-Roma
Copy link

i-Roma commented Sep 9, 2020

Same issue... Is there any solution? Who can share, please?

@skywinder skywinder added the help wanted Extra attention is needed label Sep 21, 2020
@skywinder
Copy link
Collaborator

@i-Roma What a "Heisenbug"
Can't reproduce it. can you provide nore details?

@skywinder skywinder reopened this Sep 21, 2020
@skywinder skywinder added the 💸 gitcoin-bounty Earn money by helping with this issue! label Sep 21, 2020
@skywinder
Copy link
Collaborator

Keep in mind that enchantments & pull requests to this repo are eligible for the GitCoin grant program that we received.
So if you are willing to contribute - don't hesitate to do this. I will make a bounty (by ETH or Dai) to reward your contribution!

@TheCodewr
Copy link
Author

Guy's, please make sure you are using your own endpoint. Chances are high you are using Maininfura() wich is a global pool limited by 10000 calls/ day
Use your own end point URL + infura key and you will have your own cotas of 10000 calls / day (free), solving the error

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of this issue was increased to 0.077 ETH (26.3 USD @ $341.51/ETH) .

@skywinder
Copy link
Collaborator

skywinder commented Sep 26, 2020

@TheCodewr, thanks for the clarification! this is the most probable the solution for this issue!

Well, since I already fund this issue and looks like it's impossible to solve
I would to offer to add a simple check with log in the code for this error with human readble anwer, what's goes wrong and write a paragraph in readme with an explanation of how to fix this.

So I will be ready to assign this bounty for this fix

Requirements to succeed this bounty:

  • add internal code-check for this error: that user uses public node and send explicit warning, about public node limitation and suggestion to use private node.
  • add documentation instruction how to do this

@yaroslavyaroslav
Copy link
Collaborator

Should be checked whether it reproduce in new version. Closed so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 💸 gitcoin-bounty Earn money by helping with this issue! help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests