-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
bug(forge test
): --fork-url etherscan: Failed to deserialize response
#6651
Comments
btw this is caused by this entry in foundry.toml [etherscan]
sepolia = { key = "${ETHERSCAN_KEY}" } don't have this issue when omitted don't think anything is wrong with my config because there's no issue verifying contracts elsewhere |
mind sharing the etherscan api url? |
direct copy and paste [rpc_endpoints]
mainnet = "${MAINNET_RPC_URL}"
sepolia = "${SEPOLIA_RPC_URL}"
[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY}", url = "https://api.etherscan.io/api" }
sepolia = { key = "${ETHERSCAN_API_KEY}", url = "https://api-sepolia.etherscan.io/api" } and .env MAINNET_RPC_URL="http://127.0.0.1:8545"
SEPOLIA_RPC_URL="http://127.0.0.1:8546"
ETHERSCAN_API_KEY="RR2Q7D9SP4ATYZENACMCSWC5QPXTTVH318" if i use url = "https://api.sepolia.etherscan.io/api" i actually don't get the error, but this can't be correct right? additionally, it's not getting any of the traces it should when i remove all my vm.labels (that was my workaround) |
|
tried passing that but i get |
and
I ran into a similar issue (see above), here's what I discovered:
PS: the etherscan key must be commented out from the .env if using it, as unsetting the variable doesn't prevent forge from loading the environment file. |
This worked for me, though (probably because I was running from a script?) |
this one works for me |
Correct, I edited my message to add this precision as it was indeed not specified. |
trying to compile Optimism L2 on Sepolia Testnet
|
Yes it's probably related to the same error. That's also what I had (i.e., Access denied). |
Same here, after several attempts on gas estimation for Optimism deployment on Sepolia - suddenly started getting this error |
Same issue with Holesky |
Hey getting the same error what can i do |
forge test
): `--fork-url etherscan: Failed to deserialize response
forge test
): `--fork-url etherscan: Failed to deserialize responseforge test
): --fork-url etherscan: Failed to deserialize response
@slordua there were some changes for handling such, could you please let us now if you still facing the issue in latest version? thank you! |
Same problem here, running forge 0.2.0 (9501589 2024-10-30T00:22:24.244150356Z) |
@hernandp can you share a way to reproduce the issue? Thank you |
I think this is all just related to receiving some kind of non-JSON formatted HTML error / gate page that Etherscan may throw. We could attempt to implement an error handler to give the user a more descriptive error but I don't see a practical way we can actually resolve this. It clearly happens sporadically and under certain conditions. |
It worked in Sepolia/Arbitrum Sepolia now, thanks. In particular, Celo both Testnet/Mainnet does not support |
thanks, is that celoscan to support this? @zerosnacks wdyt? |
@grandizzy @zerosnacks Sidenote, manual submission of data to Celoscan using generated JSON with |
sorry i'm not working in crypto anymore good luck guys |
Am able to reproduce it reliably on the Celoscan Alfajores testnet upon verification: <!DOCTYPE html>
<html lang="en-US">
<head>
<title>Just a moment...</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0
}
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
color: #313131;
font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji
}
body {
display: flex;
flex-direction: column;
height: 100vh;
min-height: 100vh
}
.main-content {
margin: 8rem auto;
max-width: 60rem;
padding-left: 1.5rem
}
@media (width <=720px) {
.main-content {
margin-top: 4rem
}
}
.h2 {
font-size: 1.5rem;
font-weight: 500;
line-height: 2.25rem
}
@media (width <=720px) {
.h2 {
font-size: 1.25rem;
line-height: 1.5rem
}
}
#challenge-error-text {
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI0IyMEYwMyIgZD0iTTE2IDNhMTMgMTMgMCAxIDAgMTMgMTNBMTMuMDE1IDEzLjAxNSAwIDAgMCAxNiAzbTAgMjRhMTEgMTEgMCAxIDEgMTEtMTEgMTEuMDEgMTEuMDEgMCAwIDEtMTEgMTEiLz48cGF0aCBmaWxsPSIjQjIwRjAzIiBkPSJNMTcuMDM4IDE4LjYxNUgxNC44N0wxNC41NjMgOS41aDIuNzgzem0tMS4wODQgMS40MjdxLjY2IDAgMS4wNTcuMzg4LjQwNy4zODkuNDA3Ljk5NCAwIC41OTYtLjQwNy45ODQtLjM5Ny4zOS0xLjA1Ny4zODktLjY1IDAtMS4wNTYtLjM4OS0uMzk4LS4zODktLjM5OC0uOTg0IDAtLjU5Ny4zOTgtLjk4NS40MDYtLjM5NyAxLjA1Ni0uMzk3Ii8+PC9zdmc+);
background-repeat: no-repeat;
background-size: contain;
padding-left: 34px
}
@media (prefers-color-scheme:dark) {
body {
background-color: #222;
color: #d9d9d9
}
}
</style>
<meta http-equiv="refresh" content="390">
</head>
<body class="no-js">
<div class="main-wrapper" role="main">
<div class="main-content"><noscript>
<div class="h2"><span id="challenge-error-text">Enable JavaScript and cookies to continue</span></div>
</noscript></div>
</div>
<script>(function () { window._cf_chl_opt = { cvId: '3', cZone: "explorer.celo.org", ... }());</script>
</body>
</html> I'll reach out to Etherscan to see if we can get this fixed for Celo Unfortunately it looks like there is no direct action Foundry can take here |
@zerosnacks thank you. |
Looking into this from Etherscan's end! |
Thanks @0xV4L3NT1N3! The HTML error that gets thrown originates from Blockscout due to a misclassification in the Alloy Chain's configuration, adding a fix here: alloy-rs/chains#109. Should land in Foundry soon. In the meantime as a workaround @hernandp, please directly pass in the |
Fix has been merged into Foundry in: #9242 If you are running into a similar issue please leave a comment on this ticket, it is likely related to a misclassification of the explorer or an incorrect API URL |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (73fb616 2023-12-19T00:16:21.131413571Z)
What command(s) is the bug in?
forge test --fork-url $SEPOLIA_RPC_URL
Operating System
Linux
Describe the bug
i found #3621 which is very similar to my issue to be closed in lieu of #6079, so i apologize if this is dup issue,
there is nothing special about my test, and everything passes and completes without issues. unlike @amusingaxl however, trace shows no problems with rate limiting, traces all look pretty standard:
2023-12-21T23:26:59.714575Z WARN etherscanidentifier: could not get etherscan info: Serde(Error("expected value", line: 1, column: 1))
response (captcha):
i am working on a remote server thru vscode remote ssh, not sure if that's a factor
The text was updated successfully, but these errors were encountered: