Commit 0148b19
committed
fix(auditor): attribute empty-EID inputs to their own token owner
completeInputsWithEmptyEID booked every input with an unresolved
enrollment ID under the first output's enrollment ID -- for a payment
that is the recipient, so the payer's whole input was recorded as spent
by the counterparty and both parties' eid-keyed audit balances corrupt
silently.
Resolve the enrollment ID (and revocation handle) from the input token's
owner instead, preferring the audit info already carried by the record
over the local identity store: WalletManager gains GetEIDAndRH taking
explicit audit info, falling back to the stored one when empty. An owner
that maps to no single enrollment ID -- a composite owner such as a
multisig, or one whose audit info this auditor does not hold -- leaves
its input unattributed. Amount aggregations skip an empty enrollment ID,
so an unattributed input is counted for nobody, whereas a guessed one is
charged to the wrong party.
Run the gap filling in Audit, before the enrollment IDs are collected,
so the locks cover the enrollment ID each input is finally booked under.
Append keeps its call as a fallback for callers that skip Audit; on an
already attributed record it returns immediately, leaving the number of
vault reads unchanged.
Fixes #2198
Signed-off-by: Evan <evanyan@sign.global>1 parent 714a6b4 commit 0148b19
4 files changed
Lines changed: 372 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
55 | 68 | | |
56 | 69 | | |
57 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
| |||
415 | 417 | | |
416 | 418 | | |
417 | 419 | | |
418 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
419 | 424 | | |
420 | 425 | | |
421 | 426 | | |
422 | 427 | | |
423 | 428 | | |
424 | | - | |
425 | | - | |
426 | 429 | | |
427 | 430 | | |
428 | 431 | | |
429 | 432 | | |
430 | 433 | | |
431 | 434 | | |
432 | 435 | | |
| 436 | + | |
433 | 437 | | |
434 | 438 | | |
435 | | - | |
436 | 439 | | |
437 | 440 | | |
438 | 441 | | |
439 | 442 | | |
440 | 443 | | |
441 | 444 | | |
442 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
443 | 460 | | |
444 | 461 | | |
445 | 462 | | |
| |||
0 commit comments