Skip to content

a reconstructed trade size must say what it was reconstructed from - #3176

Merged
Flotapponnier merged 1 commit into
devfrom
feat/grossed-row-evidence
Oct 22, 2026
Merged

Flotapponnier merged 1 commit into
devfrom
feat/grossed-row-evidence

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

The fills comparison with pump is not verifiable without this.

A reader checking a pump row against the chain sees the router spent 9.905 while the table says 10.00, and concludes the bench is wrong. They would be right to: the value given was grossed up by the schedule and nothing on the row said so, or by how much.

The arithmetic can be correct and still useless if one line cannot be reconciled with one transaction.

What changes

Each grossed row carries grossed_from, the spend it came from. Subtracting gives the deduction, and the deduction is precisely what pump says it does not charge, so the row becomes its own evidence rather than something to take on trust.

omitempty on purpose: every other row is read directly, and a zero would say grossed from nothing rather than read from the chain.

Tests

  • a grossed row adds up against itself, and its deduction sits inside the schedule rather than being an arbitrary gap
  • a directly read row carries no reconstruction
  • a user-funded spend is published as read, never claiming a deduction nobody took

The fills comparison is not verifiable without this. A reader checking a pump
row against the chain sees the router spent 9.905 while the table says 10.00
and concludes the bench is wrong. They would be right to: the value given was
grossed up by the schedule and nothing on the row said so, or by how much.

The arithmetic can be correct and still useless if one line cannot be
reconciled with one transaction.

Each grossed row now carries the spend it came from. Subtracting gives the
deduction, and the deduction is precisely what pump says it does not charge,
so the row becomes its own evidence instead of something to take on trust.

omitempty on purpose: every other row is read directly, and a zero would say
grossed from nothing rather than read from the chain.

Three tests: a grossed row adds up against itself and its deduction sits inside
the schedule, a directly read row carries no reconstruction, and a user-funded
spend is published as read rather than claiming a deduction nobody took.
@Flotapponnier
Flotapponnier merged commit 14fcbe9 into dev Oct 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant