fix(cli): reuse connections to EVM nodes under concurrent calls #1547
<!-- dependency-review:govulncheck -->
Vulnerable dependencies
1 advisory across 1 library need attention, 2 accepted.
:rotating_light: Needs attention
github.com/cosmos/evm
In use: v0.7.3 — reached from e2e
| Advisory | CVE | Fixed in | Summary |
|---|---|---|---|
| GO-2025-3684 | — | no fix yet | Cosmos EVM Allows Partial Precompile State Writes in github.com/cosmos/evm |
Run make vulncheck for the call paths. Either upgrade the library, or add the
advisory to .govulncheck-ignore with a reason if no fix exists yet.
Accepted
Listed in .govulncheck-ignore with a reason.
github.com/pion/dtls/v2
In use: v2.2.12 — reached from cli
| Advisory | CVE | Fixed in | Summary |
|---|---|---|---|
| GO-2026-4479 | CVE-2026-26014 | no fix yet | Usage of random nonce generation with AES GCM ciphers risks leaking the authentication key in github.com/pion/dtls |
golang.org/x/crypto
In use: v0.57.0 — reached from cli, e2e
| Advisory | CVE | Fixed in | Summary |
|---|---|---|---|
| GO-2026-5932 | — | no fix yet | The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues |
<sub>From make vulncheck-json on this run: logs.</sub>
<!-- greptile_summary -->
<h2><a href="https://app.greptile.com/api/retrigger?id=79376228"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a>Confidence Score: 4/5</h2>
[Medium impact] Changes how the CLI connects to blockchain nodes\.
The PR appears safe to merge, with a non-blocking improvement needed to keep the new test from stalling after a failed request.
<h2>Findings</h2>
1. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"> Failed requests stall the test <a href="https://github.com/cosmos/ibc/pull/1547#discussion_r4251918269">▶</a>
<h3>Summary</h3>
Dial now gives EVM HTTP clients one shared transport.
<details><summary><h3>Diagram</h3></summary>
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Chain HTTP client] --> T[Shared HTTP transport]
B[Transaction HTTP client] --> T
T --> P[Up to 256 idle connections per host]
P --> N[EVM node]
</details>
<!-- greptile_confidence_score:4 -->
<sub>Reviews (1) · Last reviewed commit: "fix(cli): reuse connections to EVM nodes..." · Reviewed by Greptile</sub>
<a href="#"><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> Failed requests stall the test
If a request fails before reaching inFlight.Done(), the remaining handlers wait forever for all 20 requests. t.Context() has no deadline, and calls.Wait() prevents cleanup from starting. This can delay CI until the whole test run times out.
Give requests a deadline and let handlers leave the barrier when the round fails or times out. A request deadline alone would still leave srv.Close() waiting for the blocked handlers.
Approved these changes.
<!-- linear-linkback -->
<p><a href="https://linear.app/cosmoslabs/issue/FOU-1763">FOU-1763</a></p>
swift1337
gjermundgaraba
Summary
The relayer and attestors dial EVM nodes with go-ethereum's default HTTP client, which keeps only two idle connections per host. Every concurrent call beyond two opens and closes its own connection, so a relayer under load leaves the host's local ports in TIME_WAIT until new connections fail with "can't assign requested address". A sustained Besu load run logged 21,570 such errors from the relayer and starved the whole machine of ports.
Dialnow shares one HTTP transport that keeps up to 256 idle connections per node.Test plan
go test ./internal/chains/evm/incli/, including a test that concurrent calls reuse connectionsgolangci-lint run ./internal/chains/evm/...🤖 Generated with Claude Code