Skip to content

ledger: CurrenciesIn's overflow-bound comment names takeLocked; foldLocked holds the reservation #1178

Closed

Description

@huang195

Found by the round-3 strict review of #1153, in a comment that PR's round 2 added.

core/cost/ledger/query.go says the capped minute keeps maxLabelsPerMinute-1 real rows, "Minus one because takeLocked reserves the last slot for overflowKey itself". The reservation is in foldLocked, not takeLocked — core/cost/ledger/writer.go carries if len(w.rows) >= maxLabelsPerMinute-1 in that function.

The number is right and the conclusion it supports (the overflow row is never the only row) holds. Only the function name is wrong — a mechanism stated without checking the symbol resolves, which is the specific mistake grep -rnE '^func +(\([^)]*\) *)?<Name>\b' catches.

Tracked red by the review harness as check C14, which re-derives the bound from writer.go rather than from the comment.

Assisted-By: Claude (Anthropic AI) [email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions