ethereum / remix-project

Remix is a browser-based compiler and IDE that enables users to build Ethereum contracts with Solidity language and to debug transactions.
https://remix-ide.readthedocs.io
MIT License
2.43k stars 933 forks source link

remix ide debugger can not debug due to network errors #106

Open bgits opened 4 years ago

bgits commented 4 years ago

Using both http://remix.ethereum.org/ and https://remix.ethereum.org/ to debug a mainnet transaction fails due to what seems to be a an error communicating with infura.

I have tried to provide my own node in the "deploy and run transactions" window but it continue to try to connect to infura.

When using the debugger tab, I will paste in the transaction (0x3134fc5d6ac8fe23e428f2d57ec3f15462b4b159d707a1392ffa6751cf478a11) hit "Start debugging" and receive a blue pop up in the bottom of the screen that says: "Invalid JSON RPC response: ".

In the browser console I see the following errors:

OPTIONS https://mainnet.infura.io/remix 503

and

Access to XMLHttpRequest at 'https://mainnet.infura.io/remix' from origin 'http://remix.ethereum.org' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Seems the endpoint it's trying to use no longer exists and there is no clear way to use a different endpoint for debugging.

yann300 commented 4 years ago

thanks for the report, we are working on it now

saurik commented 4 years ago

I don't know if this is happening again or still, but I'm getting the same issue. Maybe instead of using Infura this could just use my configured RPC endpoint that I'm using for my wallet?

yann300 commented 4 years ago

is is mainnet?

saurik commented 4 years ago

@yann300 Yes. I'm using mainnet.

saurik commented 4 years ago

I have the exact same error as the one presented in December (which was also mainnet).

Access to XMLHttpRequest at 'https://mainnet.infura.io/remix' from origin 'http://remix.ethereum.org' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

When I go to copy the failing request and run it using curl I get a 503 error. I have my own Infura API key, and if I use that it works; is there somewhere I can change remix to use my own RPC node?

saurik commented 4 years ago

(FWIW, I figured out how to use my own endpoint by downloading the website and just changing the build/app.js--I couldn't for the life of me get it to compile/run from git--but didn't realize I'd need a full node and that my Infura API key wouldn't give me access to the required API either; so I'm now on a quest to figure that out as an alternative to just using remix off the shelf ;P.)

kot-begemot commented 4 years ago

@saurik did you manged to figure out a soultin to debug transactions in mainnet?

saurik commented 4 years ago

@kot-begemot I was able to debug my issue by building my own state history scraper for my specific problem/contract (and so thankfully was eventually able to find my bug without needing a "debugger"). I did not ever get remix (or anything with similar functionality) working (though if I had a full node I think there is a good chance that it would have been possible by doing a recursive wget of the remix website and then modifying the JSON/RPC endpoint in the code to point at a local geth instance... I actually did this, but then realized that the debug_* API was only available with full nodes and I was running a light client).