Repository navigation
a reconstructed trade size must say what it was reconstructed from - #3176
Merged
Merged
Conversation
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.
This was referenced Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.omitemptyon purpose: every other row is read directly, and a zero would say grossed from nothing rather than read from the chain.Tests