-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance reporting of coin selections in the log. #2668
Enhance reporting of coin selections in the log. #2668
Conversation
The primary use of this instance is to provide information in the log that's useful for debugging coin selections. However, the existing instance doesn't provide much of a summary, which makes it hard at a glance to understand the important properties of a selection. This change enhances the `Buildable` instance, giving the output a fixed-length prefix that has several data points useful for debugging. Example output: ``` computed fee: 0.999345 total ada balance in: 2322.500607 total ada balance out: 2321.501262 ada balance of selected inputs: 2322.500607 ada balance of extra input: 0.000000 ada balance of requested outputs: 2164.303103 ada balance of generated change outputs: 157.198159 number of selected inputs: 13 number of requested outputs: 1 number of generated change outputs: 2 number of unique non-ada assets in selected inputs: 323 number of unique non-ada assets in requested outputs: 0 number of unique non-ada assets in generated change outputs: 323 size of remaining utxo: 34 ```
This allows the multi-line output of a serialized selection result to start on a separate line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
bors r+ |
Canceled. |
Buildable
instance for SelectionResult
.The `Fmt.genericF` function provides neatly-formatted output for record types, where each record field is rendered as `name: value` pair on a separate line.
…eports. This makes it possible to turn on the reporting of summarized coin selection reports (which are short, and fixed-length) without turning on the reporting of detailed coin selection reports (which can be extremely long).
b669f0c
to
61acff3
Compare
(view #txOutputMinimumAdaQuantity $ constraints tl pp) | ||
(calcMinimumCost tl pp tx) | ||
(tokenBundleSizeAssessor tl) | ||
(selectionCriteria) | ||
liftIO $ traceWith tr $ MsgSelectionDone sel | ||
case mSel of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to just trace Either e SelectionResult
and perform the reporting at the time of log formatting, and/or do further tracer transforms. That way, your functions aren't cluttered up with logging code.
bors r+ |
bors cancel |
(Will try to merge this again after the release is done.) |
bors cancel |
Build succeeded: |
I think the command is |
Weird! I checked the bors reference, and it claims that these are equivalent:
I guess it's a bug in the reference guide, or the command no longer exists (if it once did).
Sure! 👍🏻 |
Issue Number
ADP-890
Overview
This PR enhances the reporting of successful coin selection attempts in the log.
It creates two types of reports:
This makes it possible to turn on the reporting of summarized coin selection reports (which are short, and fixed-length) without turning on the reporting of detailed coin selection reports (which can be extremely lengthy).
Example output of a summarized report: