-
Notifications
You must be signed in to change notification settings - Fork 148
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened and what did you expect to happen?
- Bug Description:
I am using interchaintest v8 (specifically version v8.0.1-evm-comet1-inj) to set up a test environment that includes a Geth node. The geth.GethChain.Start method internally attempts to connect to its own RPC service via ethclient.Dial. However, this process fails, causing the entire test setup to fail. - Root Cause:
The issue stems from the Start method relying on GetHostRPCAddress() to retrieve the connection string. This address is constructed from Docker's port mapping information. When a Docker container's port is mapped to all of the host's network interfaces, the Docker API returns0.0.0.0as the HostIP.
The framework then directly uses this0.0.0.0to build the connection address (e.g., http://0.0.0.0:57086). However,0.0.0.0is a special address used for server binding ("listen on all interfaces") and is not a valid connection target for a client. This causes ethclient.Dial to fail.
`Expected Behavior:
The framework should recognize that 0.0.0.0 is not a valid connection IP and should automatically translate it to a usable address, such as localhost or 127.0.0.1. This would allow ethclient.Dial to connect successfully and the Start method to complete without errors.
- Suggested Fix:
In thechain/ethereum/ethererum_chain.gofile, within the Start method, check and replace the address returned byGetHostRPCAddress()before it is used byethclient.Dial.
// file: chain/ethereum/ethererum_chain.go
// ... inside Start() method
hostRPCAddr := c.GetHostRPCAddress()
if strings.HasPrefix(hostRPCAddr, "http://0.0.0.0") {
hostRPCAddr = strings.Replace(hostRPCAddr, "0.0.0.0", "127.0.0.1", 1)
}
c.rpcClient, err = ethclient.Dial(hostRPCAddr)
// ... rest of the logic
Describe how to reproduce the bug
- Steps to Reproduce:
1.Create an interchaintest test suite.
2.In SetupTest, initialize a geth.GethChain.
3.Call gethChain.Start(ctx).
4.Observe that the call fails with an error similar to "failed to dial ETH rpc host(http://0.0.0.0:...) ...".
version
v8.0.1
Relevant logs or stack trace
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working