feat(registry): add subnet-funded pool association to the repo model (#6320) - #6333
Conversation
…SONbored#6320) JSONbored#6099 models a subnet-funded pool as a distinct entity related to a repo, but RegistryRepoConfig is entirely repo-keyed with no way to record that a registered repo is backed by a subnet's reward pool. Add an optional, additive association so this can be represented without changing anything about how an organic (non-pool) repo registers. - New RepoPoolAssociation type (poolId matching JSONbored#6098's SettlementBackend shape, plus the funding subnet's netuid) and a nullable poolAssociation field on RegistryRepoConfig. - normalize parses the association from the registry's flat pool_id/subnet_id fields; both must be well-formed or the whole association is dropped, so an organic repo (and any half-populated one) round-trips byte-identical. - getRepoPoolAssociation read accessor returns a repo's association or null — the single read side JSONbored#6314's PayoutEligibleEvent construction and JSONbored#6099's pool-state reporting will consume. Closes JSONbored#6320
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-16 02:35:37 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6333 +/- ##
=======================================
Coverage 95.60% 95.60%
=======================================
Files 596 596
Lines 47135 47140 +5
Branches 15006 15008 +2
=======================================
+ Hits 45063 45068 +5
Misses 1290 1290
Partials 782 782
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Summary
RegistryRepoConfig), implementing the repo↔pool relationship Design spec: subnet-level onboarding & registration flow (extends #4789's individual-customer pattern) #6099's entity model needs while leaving organic (non-pool) repo registration byte-identical to today.RepoPoolAssociationtype (poolId— the shape Design spec: settlement-backend interface (gittensor-owned or self-built, pluggable either way) #6098'sSettlementBackend.poolIduses — plus the funding subnet'ssubnetIdnetuid) and a nullablepoolAssociationfield onRegistryRepoConfig.normalizeReponow parses the association from the registry payload's flatpool_id/subnet_idfields viaparsePoolAssociation. Both fields must be well-formed (non-empty pool id, finite subnet netuid) or the whole association is dropped tonull, so an organic repo — and any half-populated one — carries no pool fields and round-trips exactly as before.getRepoPoolAssociation(config)read accessor returns a repo's association ornull(including for a missing/unregistered config) — the single read side Persist rental-ledger consumption entries against the settlement-backend interface #6314'sPayoutEligibleEventconstruction and Design spec: subnet-level onboarding & registration flow (extends #4789's individual-customer pattern) #6099's pool-state reporting UI will consume.This mirrors the existing
timeDecay/parseTimeDecayOverridespattern in the same file (a nullable, defensively-parsed, grouped override that isnullwhen absent). No settlement mechanics, no pricing/allocation, no UI — data model only.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #6320).Validation
git diff --checknpm run typechecknpm run test:coveragelocally —test/unit/registry.test.tspasses; the diff (both new functions and every||/?./??branch) is at 100% line and branch coverage. The only failing suites in the full run areselfhost-ams-reporting,miner-discover-cli, andminer-live-issue-snapshot, which shell out to thesqlite3CLI binary that is absent from this local sandbox — unrelated to this diff and green on CI.npm run ui:openapi:check(no drift;RegistryRepoSchemais a curated subset that already omits the parallel internaltimeDecayfield, sopoolAssociationfollows that precedent and needs no OpenAPI change).Safety
ui:openapi:check).UI Evidencenot applicable (data-model/types only).Notes
poolAssociationis optional and defaults tonull; existing consumers ofRegistryRepoConfigare unaffected (repo-widetypecheckclean).Closes #6320