Error: Block not found - Web3Api (will pro plan solve this?)

Hello everyone!

I’m facing a small issue with a project I’m creating and wanted to check if this would get solved by upgrading to a PRO plan.

Currently I’m doing Web3Api.native.getBlock(...) on every block on various blockchains in order to get all the transactions. This works fine most of the time but every once in a while (and pretty often if I run all on parallel) I get the error “Error: Block not found”.

For this I implemented a simple retry when this happens with a small delay before retrying depending on the blockchain. If I run them individually, the retry never fails, but if I run them all in parallel the retry fails.

So on the PRO plan I saw that there are “Auto-scaling requests” and “Higher limit rates” as well as an “Excess request price…”

My question is then, by paying the pro plan (and the excess if they apply) will this problem get solved?

Thanks

That could be because you tried to look for a block that is not yet created or not yet indexed at the Moralis server.

Adding delay is the best fix for this, but I did not understand what you meant by running them all in parallel. Do you mean multiple retries on different chains?

You are checking new blocks? Or it happens if old blocks also?

So how this works is that I have a docker instance per chain , each instance dedicated to one blockchain. And the way it triggers the Web3Api.native.getBlock is by being subscribed to an rpc first. Then everytime a new block is mined it gives me the block number and I pass that one to the Web3Api.

Most likely it is that it has not been indexed yet.

1 Like

Added some clarification on my reply to johnversus.

1 Like