• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

enbility / ship-go / 33387789344
93%

Build:
DEFAULT BRANCH: dev
Ran 31 Aug 2026 11:40AM UTC
Jobs 1
Files 46
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

31 Aug 2026 11:36AM UTC coverage: 93.061% (+0.3%) from 92.733%
33387789344

push

github

web-flow
fix(ship): resolve double connections by SKI and recency (TC_SHIP_CONN_001) (#106)

# fix(ship): resolve double connections by SKI and recency
(TC_SHIP_CONN_001)

Fixes #96.

## The problem

SHIP 12.2.2 says the node with the bigger 160-bit SKI keeps the **most
recent**
connection to a peer and closes all others. `keepThisConnection`
implemented something
else — keep whichever connection the higher-SKI node *initiated* — and
said so in its own
comment:

```go
// This is hard to implement without any flaws. Therefore I chose a
// different approach: The connection initiated by the higher SKI will be kept
```

That rule is symmetric, so it always converged on one connection, but it
is not the
spec's rule, and TC_SHIP_CONN_001 fails on it. With the DUT holding the
larger SKI the
test tool opens connection B as soon as it sees the TCP stream of the
DUT's connection A;
the DUT is required to keep B and close A, and instead keeps A and tears
down B after B
has completed a handshake.

Getting the criterion right is necessary but not sufficient. The old
check ran after the
TLS handshake *and* the websocket upgrade, while the test expects A
closed "within 30s
(latest before the TLS handshake of connection B completes)" — and at
that point A is not
even a connection yet, it is an in-flight `dialer.Dial` with no handle
to cancel.

## What changed

**The criterion.** `keepThisConnection` is replaced by
`resolveDoubleConnection`. The
direction a connection was opened in is no longer an input — that
parameter *was* the bug.

**The decision moved into the TLS handshake.** `verifyPeerCertificate`
now performs the
arbiter check, which is what SHIP 12.2.2 asks for: *"The SHIP node with
the greater SKI
SHOULD check for double connections directly during the TLS handshake."*
It never rejects
the incoming connection; it only retires the older one.

**The outgoing dial became cancellable.** `connectionsInitiating`
carries the raw socket
(`dialState`), so that check can abo... (continued)

154 of 169 new or added lines in 7 files covered. (91.12%)

5 existing lines in 4 files now uncovered.

6022 of 6471 relevant lines covered (93.06%)

15184.64 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
82.64
-1.57% hub/hub_connections_server.go
4
87.05
10.96% hub/hub_connections_client.go
3
97.04
0.24% hub/hub_connections_registry.go
2
92.31
hub/hub_connections_dialstate.go

Coverage Regressions

Lines Coverage ∆ File
2
81.11
0.0% cert/cert.go
1
87.05
10.96% hub/hub_connections_client.go
1
97.04
0.24% hub/hub_connections_registry.go
1
82.64
-1.57% hub/hub_connections_server.go
Jobs
ID Job ID Ran Files Coverage
1 33387789344.1 31 Aug 2026 11:40AM UTC 46
93.06
GitHub Action Run
Source Files on build 33387789344
  • Tree
  • List 46
  • Changed 8
  • Source Changed 6
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #33387789344
  • df9fdf64 on github
  • Prev Build on dev (#30808179265)
  • Next Build on dev (#33493256316)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc