Start DIN-Indexer
Maintainer thường phản hồi trong vòng 1 ngày
@robertocarlous đang làm issue này rồi.
Từ ngày 15/7/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Branch: feat/din-indexer
Assignee: @robertocarlous
Roadmap ref: P4-IDX1 (design) · P4-IDX2 (implementation) · P4-IDX3 (integration) · Developer/issues/indexer.md
Long-running issue. This was Option B of Robbert's original two-option task (June 2026); he chose Option A — upgradeable platform contracts, delivered as PR #13 and tracked in
Developer/tasks/task_240626_0b.md. Option B now becomes its own effort here, aligned with the P4-IDX work-package series (scheduled Oct–Nov 2026, but design work can start earlier). Detailed task files underDeveloper/tasks/will follow.
Goal
Build an indexer over the events of the 4 platform-level contracts (DinCoordinator, DinToken, DinValidatorStake, DINModelRegistry) and wire at least one real dincli RPC-loop call site to query it instead of enumerating on-chain counters over RPC.
Guiding principle (from Developer/issues/indexer.md): contracts stay the canonical coordination/settlement layer with strong events; the indexer owns filtering, pagination, dashboards, and historical queries. No storage-heavy on-chain enumeration for read convenience.
Scope
Design (P4-IDX1)
- Choose the indexing approach and document the tradeoff: The Graph Protocol subgraph (preferred — production experience) vs. a lighter alternative (Ponder, or a custom event-poller backed by a local DB) if local subgraph test infra is a blocker
- Entity schema covering all event streams of the 4 platform contracts (registrations, requests/approvals, stake/slash/blacklist, fee changes, transfers)
-
subgraph.yaml+schema.graphql(or the equivalent for the chosen tool) - Local Graph node (or equivalent) running against the local Hardhat chain for development testing
- Event-coverage audit: which meaningful state transitions currently emit no event, or events with insufficient/unindexed fields, for clean state reconstruction — propose minimal contract-side event additions rather than storage changes
- Daemon event schema: define which events
dindneeds to subscribe to and current coverage gaps — this feeds P4-7.1 (on-chain event listening) in the "start DIN daemon" issue (#21)
Implementation (P4-IDX2)
- Mapping handlers for all platform-contract events; verify entities index correctly against test transactions on the local node
- Replace the pending-request enumeration loop in
dincli/cli/dindao.py(lines ~441–465:for idx in range(totalModelRequests)and the matching manifest-request loop) with an indexer-backed query, proving the integration end-to-end - Local run instructions (setup steps, docker-compose if needed) + ≥3 example queries covering validator registry, model registry, and reward/slash history
- Write-up: approach chosen and why, integration point, and the follow-up candidate loop sites — known ones today:
dincli/cli/modelownerd/lms.py(~line 62) andaggregation.py(~lines 76, 95, 136)
Integration & wrap-up (P4-IDX3)
- Wire the indexer into the
dinclitest suite; the replaced call site passes tests against the indexed local node - Handoff notes: what follows in P5+ (task-level contract indexing via dynamic data sources, event-schema extensions for
dind) - Doc-correction pass on
Developer/issues/indexer.md: note stale references or contradictions with current contract code (same convention as the PR #13 doc-inaccuracy list)
Explicitly out of scope
- Dynamic data sources for task-level contracts (
DINTaskCoordinator/DINTaskAuditor) — materially harder Graph pattern with its own deploy/hosting story; deferred to P5+, document as follow-up only - Rewriting
dincli's general data-access layer (DinContextstays as-is beyond the one wired call site) - Hosting / production deployment of the indexer
- Governance dashboards — the DIN-DAO issue (#23) designs its contracts events-first so this indexer can cover them later
Dependencies & sequencing
Per Developer/ROADMAP.md, P4-IDX1 depends on stable contract ABIs (P3-6.3b) and proxy contracts deployed (PR #13) — indexing against ABIs that are still churning means redoing mappings. Design work (approach tradeoff, entity schema, event-coverage audit) is safe to start earlier; hold mapping implementation until the ABI surface settles.
References
Developer/issues/indexer.md— the indexer-first architecture blueprint (events-first contract design, what stays on-chain vs. moves to the indexer)Developer/ROADMAP.md— P4-IDX1/IDX2/IDX3 work packages- Original task spec: Option B in Robbert's June task (kept outside the repo); condensed Option A record at
Developer/tasks/task_240626_0b.md - Related issues: #21 "start DIN daemon" (consumes the daemon event schema), #23 "Start DIN-DAO" (future governance event streams)
Branching note
feat/din-indexer on the main repo (contributor branch, not a fork-based trial). Indexer code should live in its own top-level directory (e.g. indexer/ or subgraph/ — pick one and document it) so it doesn't tangle with dincli/, foundry/, or hardhat/.
- Ngôn ngữ chính
- Python
- Star
- 4
- Fork
- 7
- Merge trung bình
- 3 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 34
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của InfiniteZeroFoundation/DevNet
-
ROADMAP.md: refresh "What is still open for P3" (several items were fixed in October)Có thể đã có người làm @umermjd11 đã nhận 2 ngày trước. Đang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
InfiniteZeroFoundation/DevNet#285 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update the 25 translated organisation READMEs to match the English versionCó thể đã có người làm @mrCabez đã nhận hôm nay. Đang mởgood first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
InfiniteZeroFoundation/DevNet#277 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update the client-service guide to explain training and uploading separatelyCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
InfiniteZeroFoundation/DevNet#266 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
InfiniteZeroFoundation/DevNet#299 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Long run
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
InfiniteZeroFoundation/DevNet#298 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của InfiniteZeroFoundation/DevNet
Issue tương tự
-
priority middle
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
KATO-Hiro/AtCoderClans#12940 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
huggingface/huggingface_hub#5283 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
ccxt/ccxt#31045 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug example
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày