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

cast etherscan-source seems to not work #508

Closed
2 tasks done
brotherlymite opened this issue Aug 8, 2024 · 4 comments · Fixed by #541
Closed
2 tasks done

cast etherscan-source seems to not work #508

brotherlymite opened this issue Aug 8, 2024 · 4 comments · Fixed by #541

Comments

@brotherlymite
Copy link

Component

Cast

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

No response

What command(s) is the bug in?

cast 0.0.2 (fb6d0c5 2024-08-08T00:23:13.876828000Z)

Operating System

macOS (Apple Silicon)

Describe the bug

When downloading source contracts from etherscan using cast, getting a Failed to deserialize content error.

To reproduce, run this command: RUST_LOG=trace cast etherscan-source --chain-id 324 -d downloads/POOL_ADDRESSES_PROVIDER 0xE8bC6e12faf260dbA1c942134070221B11BF37Fb

Getting the trace error message:
2024-08-08T12:36:49.650595Z TRACE foundry_config: load config with provider: Metadata { name: "Default", source: None, provide_location: None, interpolater:  }
2024-08-08T12:36:49.896194Z TRACE etherscan: GET https://zksync2-mainnet-explorer.zksync.io/
2024-08-08T12:36:49.897997Z TRACE hyper_util::client::legacy::pool: checkout waiting for idle connection: ("https", zksync2-mainnet-explorer.zksync.io)
2024-08-08T12:36:49.898210Z DEBUG reqwest::connect: starting new connection: https://zksync2-mainnet-explorer.zksync.io/    
2024-08-08T12:36:49.898712Z TRACE hyper_util::client::legacy::connect::http: Http::connect; scheme=Some("https"), host=Some("zksync2-mainnet-explorer.zksync.io"), port=None
2024-08-08T12:36:49.899033Z DEBUG hyper_util::client::legacy::connect::dns: resolving host="zksync2-mainnet-explorer.zksync.io"

2024-08-08T12:36:50.161061Z DEBUG hyper_util::client::legacy::connect::http: connecting to 34.117.27.124:443
2024-08-08T12:36:50.162003Z TRACE mio::poll: registering event source with poller: token=Token(4348109952), interests=READABLE | WRITABLE    
2024-08-08T12:36:50.414206Z DEBUG hyper_util::client::legacy::connect::http: connected to 34.117.27.124:443
2024-08-08T12:36:51.077874Z TRACE hyper_util::client::legacy::client: http1 handshake complete, spawning background dispatcher task
2024-08-08T12:36:51.078555Z TRACE hyper_util::client::legacy::pool: checkout dropped for ("https", zksync2-mainnet-explorer.zksync.io)
2024-08-08T12:36:51.483496Z TRACE hyper_util::client::legacy::pool: put; add idle connection for ("https", zksync2-mainnet-explorer.zksync.io)
2024-08-08T12:36:51.483586Z DEBUG hyper_util::client::legacy::pool: pooling idle connection for ("https", zksync2-mainnet-explorer.zksync.io)
2024-08-08T12:36:51.485085Z ERROR etherscan: Failed to deserialize response: EOF while parsing a value at line 1 column 0 res=""
2024-08-08T12:36:51.486246Z TRACE mio::poll: deregistering event source from poller    
Error: 
Failed to deserialize content: EOF while parsing a value at line 1 column 0

My guess is it is breaking due to incorrect api url.

@Karrq
Copy link
Contributor

Karrq commented Aug 8, 2024

It indeed seems that the URLs present on alloy-chains are not the ones we expect.
Unfortuantely, it seems there's no way to specify which URL to use manually, so there's no easy workaround for it yet.

@sakulstra
Copy link
Contributor

shouldn't it be possible to just replace the default explorer to https://era.zksync.network/ as i think should be api compatible

@brotherlymite
Copy link
Author

brotherlymite commented Aug 8, 2024

@Karrq alloy-chains is now pointing to the correct api. #78

@nbaztec
Copy link
Collaborator

nbaztec commented Aug 8, 2024

@brotherlymite Since this functionality has just been merged, we'd need to wait for the new release from the maintainers. Once it's done we can patch it in our repository.

@sakulstra Since cast relies on chain-id to infer urls, this would be inconsistent with the url provided in the config. In any case, this involves adding a feature that's not present on upstream foundry, and could take a while. Similar to foundry-rs/foundry#4776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants