🐛 Backend on Koios is slow to start on preview
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- backend, performance
調査の方向性
Start with CacheWarmerService.onModuleInit and CacheService.refresh to trace startup warming and in-flight requests. Then inspect the Koios provider methods loadDirectory, loadUpdates('all'), loadDRepInfo, and loadAggregates. Done means startup listens before the first warm completes, concurrent requests share that warm, DRep directory data is reused per tip, and concluded actions avoid new summary calls.
索引モデルが issue の本文から書いたものです。
説明
Area
Other (backend, Koios provider)
Domain
Custom setup: govtool-backend v2.1.0-alpha.2, GOVTOOL_CHAIN_DATA_PROVIDER=koios, GOVTOOL_KOIOS_NETWORK=preview
Steps to reproduce
- Start
govtool-backendon Koios with networkpreview. - Wait for it to listen on port 9999.
Actual behavior
The backend does not listen, not even for its health check, until the first snapshot warm finishes. On preview this takes much longer than on mainnet.
Expected behavior
The backend listens immediately and the warm runs in the background.
Cause
CacheWarmerService.onModuleInit awaits a full DRep and proposal snapshot before Nest listens, and on Koios that snapshot scales badly:
- DReps:
readAllreads 500 rows per page, but each Koiosdreps.listcall re-reads all of/drep_listand/drep_updatesbefore slicing its page, so the cost grows with pages × collection size. - Proposals:
loadAggregatesmakes one/proposal_voting_summarycall per action, concluded ones included.
Preview is about 10× mainnet. Per-request latency is not the problem: preview answered as fast as mainnet.
| Public Koios | mainnet | preview |
|---|---|---|
| DReps / certificates | 1,687 / 3,583 | 15,283 / 23,390 |
| Governance actions | 158 | 1,552 |
| Requests for the DRep snapshot | ~56 | ~1,490 |
/proposal_voting_summary calls |
158 | 1,552 |
Suggested change
- Don't block startup: in
CacheWarmerService.onModuleInit, fire the first refresh without awaiting it. HaveCacheService.refreshstore its in-flight promise likegetOrSetdoes, so requests that arrive during the warm wait on it instead of starting a second full read. - Read the directory once per snapshot: in the Koios provider, memoise
loadDirectory,loadUpdates('all')andloadDRepInfoper chain tip. This cuts preview's DRep snapshot from ~1,490 requests to ~290. - Skip concluded actions: their tallies are final, so keep them by action id and call
/proposal_voting_summaryonly for live actions.
1 fixes startup. 2 and 3 shrink the warm, which also re-runs on every new block.
- 主要言語
- HTML
- スター
- 22
- フォーク
- 28
- 平均マージ
- 19時間 45分
- マージ済み PR(30日)
- 38
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
IntersectMBO/govtool のほかの issue
-
🏗 Infrastructure
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
IntersectMBO/govtool#4297 ·
メンテナーはふだん 1 日以内に返信
-
⚙ Backend 📜 Proposal Pillar 2026-Revamp
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
IntersectMBO/govtool#4279 ·
メンテナーはふだん 1 日以内に返信
-
Wrap up the PDF backend for production: Strapi data import, lookup data and admin tasks対応中かも @kusssal が 25 日前に担当しました。 オープン⚙ Backend 📜 Proposal Pillar 2026-Revamp
IntersectMBO/govtool#4278 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
🖥 Frontend 2026-Revamp
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
IntersectMBO/govtool#4275 ·
メンテナーはふだん 1 日以内に返信
-
💡 Feature idea
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
IntersectMBO/govtool#4268 ·
メンテナーはふだん 1 日以内に返信
IntersectMBO/govtool の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
OneBusAway/maglev#1914 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
sususweet/midea_auto_cloud#284 ·
メンテナーはふだん 1 日以内に返信
-
2026-11 bug good first issue gsoc-2027 project: earthmind
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
alphaonelabs/website#1136 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
BoardGamesEmpire/board-games-empire-backend#1027 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
chriskelly/wish-together#102 ·
メンテナーはふだん 1 日以内に返信