[testing] changing default local test-validator address from localhost to 127.0.0.1#2725
Conversation
|
@ochaloup is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
acheroncrypto
left a comment
There was a problem hiding this comment.
I think this is a reasonable change given Node 17 no longer prioritizes IPv4 adresses and made localhost resolution host specific in nodejs/node#39987
Could you add a CHANGELOG entry before we merge?
0881711 to
0e41788
Compare
0e41788 to
2ee1fa4
Compare
|
@acheroncrypto I changed the changelog. Please, take a look if the text makes sense. |
acheroncrypto
left a comment
There was a problem hiding this comment.
Thanks for updating! Small clarification for the following statement:
NodeJS 17 IP resolution changes for IPv6
My understanding is, this is not entirely correct because they didn't change the resolution to IPv6, they just stopped manually overriding to always prioritize IPv4 so it now depends on how your machine is configured to resolve localhost. If they did override to IPv6, our CI which is on Node v18 would not work with localhost. In any case, this is a small detail so we can merge as is.
I'm inspired with the change of the solana labs example here solana-labs/example-helloworld#375
From the newer nodejs servers the
localhostis resolved to ipv6::1and when I use theAnchorProvider.env()then theANCHOR_PROVIDER_URLbyanchor testis setup tohttp://localhost:8899.But the test validator is running on ipv4 as far as I can see.
When I want to use a new instance of
Connectionthat's created with theprovider.connection.rpcEndpointthen I'm getting errors likeError: failed to get recent blockhash: TypeError: fetch failed.Would that be reasonable to change the default local connection url to test validator from localhost to 127.0.0.1?