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

Slow connection (to localhost) #7430

Closed
2 tasks done
drortirosh opened this issue Mar 18, 2024 · 2 comments · Fixed by #7450
Closed
2 tasks done

Slow connection (to localhost) #7430

drortirosh opened this issue Mar 18, 2024 · 2 comments · Fixed by #7450
Labels
T-bug Type: bug

Comments

@drortirosh
Copy link

Component

Cast

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

cast 0.2.0 (42a9d34 2024-03-18T00:21:12.549807000Z)

What command(s) is the bug in?

cast ci

Operating System

macOS (Apple Silicon)

Describe the bug

I see no reason for cast to take ~3 times curl to contact localhost. This makes scripts that use cast for various rpc calls very sluggish. - 48ms to a TCP round-trip to local "get", compared to 15ms for "curl"

 $ time cast chain-id -r http://localhost:8545
1337

real	0m0.048s
user	0m0.020s
sys	0m0.020s
✔ /tmp
19:45 $ time curl -s -d '{"method":"eth_chainId","params":[],"id":1234,"jsonrpc":"2.0"}' -H content-type:application/json http://localhost:8545
{"jsonrpc":"2.0","id":1234,"result":"0x539"}

real	0m0.015s
user	0m0.003s
sys	0m0.008s
✔ /tmp
19:45 $ cast --version
cast 0.2.0 (42a9d34 2024-03-18T00:21:12.549807000Z)
@drortirosh drortirosh added the T-bug Type: bug label Mar 18, 2024
@mattsse
Copy link
Member

mattsse commented Mar 18, 2024

are you executing this in a foundry project by any chance?

this is likely because we're trying to load foundry.toml

I believe we added this so that aliases work as input args, although I think we should skip that entirely if the URL arg is actually an URL

@DaniPopes
Copy link
Member

cc #6204 #6350, will do the same on the new reqwest clients

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

Successfully merging a pull request may close this issue.

3 participants