accounting: use the accountant's own size bound (Withhold(res)), stop passing TokensBefore
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 57/100
Rechercherichtung
Read core/accounting/host.go around line 654 and core/accounting/metrics.go around line 252, then check the accountant dependency versions and the v0.11.0 API. Update the dependency and make both call-site changes described in the issue; run the accounting tests. Done when Withhold receives only the result and the observation no longer sets TokensBefore.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
Cortex passes its own request size to the accountant in two places. accountant v0.11.0 measures the size itself, and the host size is going away (rossoctl/context-guru#1523). Please move Cortex to the library's own size bound.
What we found
Cortex main at 2cb6e041 (accountant pinned at v0.10.0):
core/accounting/host.go:654:accountant.Withhold(p.result, before). This is the legacy form with a host size.core/accounting/metrics.go:252:acmetrics.Observation{..., TokensBefore: tokensBefore}. A positiveTokensBeforemakes the sink use the legacy host bound.
Why
- With a host size, the bound compares host tokens against the accountant's ratio tokens. That is two different measures. Removed text that is denser than the request average (hex, code) can then make an honest request fail as
implausible_size(rossoctl/accountant#126 review). - From v0.11.0,
Withhold(res)with no size measures the client messages itself (Result.MessageTokens,PricedOp.SavedMessages/CausedMessages, design §6.7). Tool declarations are not counted. - context-guru moved to it in rossoctl/context-guru#1529.
Proposal
- Bump to accountant and accountant/metrics v0.11.0.
core/accounting/host.go: callaccountant.Withhold(p.result).core/accounting/metrics.go: stop settingTokensBeforein theObservation.- This is a behavior change for Cortex: the size bound moves from the host measure to the library measure. The Cortex owners decide it.
After this merges, the accountant removes the size argument of Withhold, SizeNotGiven and Observation.TokensBefore in its next minor release (rossoctl/context-guru#1523, #1524).
- Vorherrschende Sprache
- Go
- Sterne
- 31
- Forks
- 49
- Ø Merge
- 9 Std. 43 Min.
- Gemergte PRs (30 T.)
- 367
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus rossoctl/cortex
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug laptop
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in rossoctl/cortex
Ähnliche Issues
-
taskmanager: a failed v1alpha1 backup leaves the partial backup behindEvtl. vergeben @arshil42 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
ether/etherpad-go#571 ·
Maintainer antworten meist innerhalb von 1 Tag
-
labeler: read a limit above math.MaxInt as math.MaxInt in nonNegative (CodeQL alerts #20 and #21)Offencost:approved factory:queued factory:tracking priority:p2 rank:12 ready-for-doing task:approved tokens:50k
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
sisaku-security/sisakulint#860 · 2 Kommentare ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100