Skip to content

Commit

Permalink
Fix slow builds on windows
Browse files Browse the repository at this point in the history
apparently it takes windows 2-3 seconds to
resolve "localhost" to 127.0.0.1 for every
json-rpc connection that we make 🤦
  • Loading branch information
markspanbroek committed Nov 14, 2024
1 parent 0410f99 commit 69122d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/ethertest.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ template ethersuite*(name, body) =

setup:
ethProvider = JsonRpcProvider.new(
"http://localhost:8545",
"http://127.0.0.1:8545",
pollingInterval = chronos.milliseconds(100)
)
snapshot = await send(ethProvider, "evm_snapshot")
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/multinodes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@ template multinodesuite*(name: string, body: untyped) =
proc startClientNode(conf: CodexConfig): Future[NodeProcess] {.async.} =
let clientIdx = clients().len
var config = conf
config.addCliOption(StartUpCmd.persistence, "--eth-provider", "http://localhost:8545")
config.addCliOption(StartUpCmd.persistence, "--eth-provider", "http://127.0.0.1:8545")
config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len])
return await newCodexProcess(clientIdx, config, Role.Client)

proc startProviderNode(conf: CodexConfig): Future[NodeProcess] {.async.} =
let providerIdx = providers().len
var config = conf
config.addCliOption("--bootstrap-node", bootstrap)
config.addCliOption(StartUpCmd.persistence, "--eth-provider", "http://localhost:8545")
config.addCliOption(StartUpCmd.persistence, "--eth-provider", "http://127.0.0.1:8545")
config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len])
config.addCliOption(PersistenceCmd.prover, "--circom-r1cs",
"vendor/codex-contracts-eth/verifier/networks/hardhat/proof_main.r1cs")
Expand All @@ -219,7 +219,7 @@ template multinodesuite*(name: string, body: untyped) =
let validatorIdx = validators().len
var config = conf
config.addCliOption("--bootstrap-node", bootstrap)
config.addCliOption(StartUpCmd.persistence, "--eth-provider", "http://localhost:8545")
config.addCliOption(StartUpCmd.persistence, "--eth-provider", "http://127.0.0.1:8545")
config.addCliOption(StartUpCmd.persistence, "--eth-account", $accounts[running.len])
config.addCliOption(StartUpCmd.persistence, "--validator")

Expand Down Expand Up @@ -268,7 +268,7 @@ template multinodesuite*(name: string, body: untyped) =
# Do not use websockets, but use http and polling to stop subscriptions
# from being removed after 5 minutes
ethProvider = JsonRpcProvider.new(
"http://localhost:8545",
"http://127.0.0.1:8545",
pollingInterval = chronos.milliseconds(100)
)
# if hardhat was NOT started by the test, take a snapshot so it can be
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/twonodes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ template twonodessuite*(name: string, debug1, debug2: string, body) =
"--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs",
"--circom-wasm=tests/circuits/fixtures/proof_main.wasm",
"--circom-zkey=tests/circuits/fixtures/proof_main.zkey",
"--eth-provider=http://localhost:8545",
"--eth-provider=http://127.0.0.1:8545",
"--eth-account=" & $account1
]

Expand All @@ -68,7 +68,7 @@ template twonodessuite*(name: string, debug1, debug2: string, body) =
"--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs",
"--circom-wasm=tests/circuits/fixtures/proof_main.wasm",
"--circom-zkey=tests/circuits/fixtures/proof_main.zkey",
"--eth-provider=http://localhost:8545",
"--eth-provider=http://127.0.0.1:8545",
"--eth-account=" & $account2
]

Expand Down
2 changes: 1 addition & 1 deletion tests/tools/cirdl/testcirdl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ suite "tools/cirdl":
test "circuit download tool":
let
circuitPath = "testcircuitpath"
rpcEndpoint = "http://localhost:8545"
rpcEndpoint = "http://127.0.0.1:8545"
marketplaceAddress = Marketplace.address

discard existsOrCreateDir(circuitPath)
Expand Down

0 comments on commit 69122d8

Please sign in to comment.