Settle ignores the ledger entry Ledger::Add returns #2

Open
opened 2026-11-02 18:34:13 +00:00 by jorijnvdgraaf · 0 comments

Settle records a finished pass with ledger->Add(...), which re-reads the shared ledger under its lock and returns the seat's entry as the file has it: every driver's spend, and any credit-out another driver recorded. Settle discards that entry. Mid-run the seat's spentUsd stays this process's own sum, and a credit-out recorded by another driver (or, from 1.1.0, by seats) does not take the seat out; passes keep going to it until one of this run's own passes hits the credit error.

The Python driver's settle uses the entry: the seat takes the file's spend, and the file's outSince puts it out.

A fix takes the returned entry's spend and credit-out in Settle, with a two-ledger test: one driver marks the key out, and the other's next settle puts its seat out.

Found by the 1.1.0 push gates.

`Settle` records a finished pass with `ledger->Add(...)`, which re-reads the shared ledger under its lock and returns the seat's entry as the file has it: every driver's spend, and any credit-out another driver recorded. `Settle` discards that entry. Mid-run the seat's `spentUsd` stays this process's own sum, and a credit-out recorded by another driver (or, from 1.1.0, by `seats`) does not take the seat out; passes keep going to it until one of this run's own passes hits the credit error. The Python driver's settle uses the entry: the seat takes the file's spend, and the file's `outSince` puts it out. A fix takes the returned entry's spend and credit-out in `Settle`, with a two-ledger test: one driver marks the key out, and the other's next settle puts its seat out. Found by the 1.1.0 push gates.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Catcrafts/Crafter.Review#2
No description provided.