rainshowerLabs/blutgang

bug: `forge test` compatibility

Closed this issue · 2 comments

Describe the bug
Forked foundry tests do not run and Blutgang throws errors.

To Reproduce
Steps to reproduce the behavior:

  1. start blutgang with default config
  2. run forge fork test

Expected behavior
The RPCs work without Blutgang, so I would expect Blutgang to work as well.

Specs:

  • OS: windows
  • Kernel: 5.10.16.3-microsoft-standard-WSL2
  • Blutgang version: current

Additional context

RUST_LOG=ethers=trace forge test

2023-12-14T07:46:51.884965Z TRACE rpc{method="eth_gasPrice" params="null"}: ethers_providers::rpc::provider: tx
2023-12-14T07:46:51.885107Z TRACE rpc{method="eth_chainId" params="null"}: ethers_providers::rpc::provider: tx
2023-12-14T07:46:51.885172Z TRACE rpc{method="eth_getBlockByNumber" params="[\"0x10abafe\",false]"}: ethers_providers::rpc::provider: tx
2023-12-14T07:46:51.885980Z TRACE rpc{method="eth_gasPrice" params="null"}: ethers_providers::rpc::provider: tx
2023-12-14T07:46:51.886062Z TRACE rpc{method="eth_chainId" params="null"}: ethers_providers::rpc::provider: tx
2023-12-14T07:46:51.886127Z TRACE rpc{method="eth_getBlockByNumber" params="[\"0x10abafe\",false]"}: ethers_providers::rpc::provider: tx
2023-12-14T07:46:51.886623Z TRACE rpc{method="eth_gasPrice" params="null"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.886811Z TRACE rpc{method="eth_chainId" params="null"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.887134Z TRACE rpc{method="eth_getBlockByNumber" params="[\"0x10abafe\",false]"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.887273Z TRACE rpc{method="eth_chainId" params="null"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.887422Z TRACE rpc{method="eth_gasPrice" params="null"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.887538Z TRACE rpc{method="eth_getBlockByNumber" params="[\"0x10abafe\",false]"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.887742Z TRACE rpc{method="eth_gasPrice" params="null"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.887914Z TRACE rpc{method="eth_chainId" params="null"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.888080Z TRACE rpc{method="eth_getBlockByNumber" params="[\"0x10abafe\",false]"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.888266Z TRACE rpc{method="eth_gasPrice" params="null"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.888429Z TRACE rpc{method="eth_chainId" params="null"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.888601Z TRACE rpc{method="eth_getBlockByNumber" params="[\"0x10abafe\",false]"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.888755Z TRACE rpc{method="eth_gasPrice" params="null"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.888912Z TRACE rpc{method="eth_chainId" params="null"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.889103Z TRACE rpc{method="eth_getBlockByNumber" params="[\"0x10abafe\",false]"}: ethers_providers::rpc::transports::retry: retrying due to spurious network err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })
2023-12-14T07:46:51.889268Z TRACE rpc{method="eth_gasPrice" params="null"}: ethers_providers::rpc::transports::retry: should not retry err=HTTPError(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(3000), path: "/", query: None, fragment: None }, source: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidMessage(InvalidContentType) } }) })

Running 1 test for test/invariant/EigenZapInvariants.t.sol:EigenZapInvariants

blutgang --config <DEFAULT_CONFIG>

Info: Using config file at blutgang.toml
Sorting RPCs by latency...
https://eth.llamarpc.com: 39629091.3ns
https://rpc.ankr.com/eth: 66638958.1ns
Info: Bound to: 127.0.0.1:3000
Wrn: Reorg detected!
Removing stale entries from the cache.
Info: Checking RPC health... OK!
Info: Checking RPC health... OK!
Info: New finalized block!
Removing stale entries from the cache.
Info: Checking RPC health... OK!
Info: Connection from: 127.0.0.1:51438
Info: Connection from: 127.0.0.1:51440
Info: Connection from: 127.0.0.1:51442
Err: Error serving connection: hyper::Error(Parse(Method))
Err: Error serving connection: hyper::Error(Parse(Method))
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Connection from: 127.0.0.1:51444
Info: Connection from: 127.0.0.1:51446
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Connection from: 127.0.0.1:51448
Info: Connection from: 127.0.0.1:51450
Err: Error serving connection: hyper::Error(Parse(Method))
Err: Error serving connection: hyper::Error(Parse(Method))
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Connection from: 127.0.0.1:51452
Info: Connection from: 127.0.0.1:51454
Info: Connection from: 127.0.0.1:51456
Err: Error serving connection: hyper::Error(Parse(Method))
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Connection from: 127.0.0.1:51458
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Connection from: 127.0.0.1:51460
Info: Connection from: 127.0.0.1:51462
Err: Error serving connection: hyper::Error(Parse(Method))
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Connection from: 127.0.0.1:51464
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Connection from: 127.0.0.1:51466
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Connection from: 127.0.0.1:51468
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Connection from: 127.0.0.1:51470
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Connection from: 127.0.0.1:51472
Err: Error serving connection: hyper::Error(Parse(Method))
Info: Checking RPC health... OK!
Info: Checking RPC health... OK!
Info: Checking RPC health... OK!
Info: Checking RPC health... OK!
Info: Checking RPC health... OK!
Info: Checking RPC health... OK!
Info: Checking RPC health... OK!
Info: New finalized block!
Removing stale entries from the cache.

Ran the https://github.com/dopex-io/dopex-v2-clamm tests as well as some others and It worked fine. Going off that, I'm assuming:

  • You're using 0.2.1 and that this is a Windows/WSL issue, or
  • You've used a broken build from a dev branch

If you are using a stable release, this is most likely a Windows issue. WSL is really buggy when it comes to things like this, so either try running it natively or inside a Linux Hyper-V VM (You'll probably get really bad performance if you tried it in a type 2 hypervisor). Keep in mind that Windows is not supported but I have received reports that it works.

Otherwise, more info as to what branch you've used and the commit tag would be nice.

@0xClandestine could you link the repository with the tests you tried to run?