Skip to content

feat: initial daemon implementation#1

Merged
andreabadesso merged 66 commits into
masterfrom
dev
May 24, 2021
Merged

feat: initial daemon implementation#1
andreabadesso merged 66 commits into
masterfrom
dev

Conversation

@andreabadesso
Copy link
Copy Markdown
Collaborator

No description provided.

@andreabadesso andreabadesso changed the title wip: initial service implementation initial service implementation Apr 8, 2021
@andreabadesso andreabadesso self-assigned this Apr 8, 2021
@andreabadesso andreabadesso changed the title initial service implementation feat: initial daemon implementation Apr 8, 2021
@andreabadesso andreabadesso requested a review from msbrogli May 6, 2021 18:28
@pedroferreira1 pedroferreira1 removed the request for review from thr0wn May 10, 2021 13:45
@andreabadesso andreabadesso merged commit 72d5d0e into master May 24, 2021
@andreabadesso andreabadesso deleted the dev branch May 24, 2021 18:19
@andreabadesso andreabadesso restored the dev branch June 1, 2021 19:34
andreabadesso added a commit that referenced this pull request Apr 17, 2026
Tier 1 fix #1 from #395. Every handler in services/index.ts ended with
mysql.destroy() in its finally block, which closes the underlying TCP
socket and defeats the pool — every subsequent call paid a fresh TCP +
MySQL auth handshake. Effectively the connection pool size was 0.

Replaced all 11 occurrences with mysql.release() so connections return
to the pool. Also corrected the getDbConnection() return type to
PoolConnection (from its alias Connection) so .release() is available
without casts.

Measured against VOIDED_TOKEN_AUTHORITY (66 events, 5 baseline runs vs
8 candidate runs):

| metric | baseline p50 | candidate p50 | Δ | 95% CI |
|---|---:|---:|---:|---|
| totalMs | 1253.6 | 967.0 | -22.9% | [-28.8%, -2.7%] 🟢 |
| metadataDiff | 138.3 | 42.40 | -69.4% | [-73.4%, -55.8%] 🟢 |
| handleTxFirstBlock | 26.79 | 15.47 | -42.3% | [-45.4%, -25.8%] 🟢 |

handleVertexAccepted directionally improved (-24.6%) but CI crosses 0
at this run count. The small handlers that do only 1–2 queries show
the largest relative gain — connection acquire was previously a
dominant fraction of their cost.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
andreabadesso added a commit that referenced this pull request Apr 20, 2026
Tier 1 fix #1 from #395. Every handler in services/index.ts ended with
mysql.destroy() in its finally block, which closes the underlying TCP
socket and defeats the pool — every subsequent call paid a fresh TCP +
MySQL auth handshake. Effectively the connection pool size was 0.

Replaced all 11 occurrences with mysql.release() so connections return
to the pool. Also corrected the getDbConnection() return type to
PoolConnection (from its alias Connection) so .release() is available
without casts.

Measured against VOIDED_TOKEN_AUTHORITY (66 events, 5 baseline runs vs
8 candidate runs):

| metric | baseline p50 | candidate p50 | Δ | 95% CI |
|---|---:|---:|---:|---|
| totalMs | 1253.6 | 967.0 | -22.9% | [-28.8%, -2.7%] 🟢 |
| metadataDiff | 138.3 | 42.40 | -69.4% | [-73.4%, -55.8%] 🟢 |
| handleTxFirstBlock | 26.79 | 15.47 | -42.3% | [-45.4%, -25.8%] 🟢 |

handleVertexAccepted directionally improved (-24.6%) but CI crosses 0
at this run count. The small handlers that do only 1–2 queries show
the largest relative gain — connection acquire was previously a
dominant fraction of their cost.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants