Skip to content
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

Less verbose LSQ pool response trace #1864

Merged
merged 2 commits into from
Jul 7, 2020

Conversation

Anviking
Copy link
Member

@Anviking Anviking commented Jul 6, 2020

Overview

  • Log the full response as DEBUG, not INFO
  • Log the size of the stake distribution and reward map as INFO

Comments

We now see:

[cardano-wallet.network:Info:65] [2020-07-06 15:07:56.63 UTC] Will query non-myopic rewards using the stake 100000000000
[cardano-wallet.network:Info:65] [2020-07-06 15:07:56.82 UTC] Fetched pool data from node tip using LSQ. Got 360 pools in the stake distribution, and 360 pools in the non-myopic member reward map.

With:

--trace-network=DEBUG

we still see the full response.

@Anviking Anviking self-assigned this Jul 6, 2020
@Anviking Anviking requested review from KtorZ and piotr-iohk July 6, 2020 15:28
@@ -381,6 +381,9 @@ withNetworkLayer tr np addrInfo versionData action = do
(optimumNumberOfPools pparams)
rewardMap
stakeMap
liftIO $ traceWith tr $ MsgFetchedNodePoolLsqDataSummary
(Map.size stakeMap)
(Map.size rewardMap)
liftIO $ traceWith tr $ MsgFetchedNodePoolLsqData res
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's one way to do it, what about using only a single message, and depending on the severity, show either the full result, or a summary :) ?

Copy link
Member Author

@Anviking Anviking Jul 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was how I first imagined it, but I don't see how.

We need to provide a severity, given a MsgFetchedNodePoolLsqData. Not the other way around. We don't know the global severity level.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... right, the ToText instance is actually not aware of the severity!

@@ -724,6 +727,9 @@ data NetworkLayerLog
| MsgDestroyCursor ThreadId
| MsgWillQueryRewardsForStake W.Coin
| MsgFetchedNodePoolLsqData NodePoolLsqData
| MsgFetchedNodePoolLsqDataSummary Int Int
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wish we had some kind of anonymous records / named-tuples (e.g. (stakeDistrSize :: Int, rewardMapSize :: Int)) for situations like these :/

Think a separate record-type is overkill and not sure Quantity "pools in stakeDistr" helps that much. Or maybe the latter?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anonymous records / named-tuples

Yeah! One of the thing I really like in Elm <3

@Anviking
Copy link
Member Author

Anviking commented Jul 6, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Jul 6, 2020
1864: Less verbose LSQ pool response trace r=Anviking a=Anviking

# Overview

- [x] Log the full response as DEBUG, not INFO
- [x] Log the _size_ of the stake distribution and reward map as INFO 

# Comments

We now see:
```
[cardano-wallet.network:Info:65] [2020-07-06 15:07:56.63 UTC] Will query non-myopic rewards using the stake 100000000000
[cardano-wallet.network:Info:65] [2020-07-06 15:07:56.82 UTC] Fetched pool data from node tip using LSQ. Got 360 pools in the stake distribution, and 360 pools in the non-myopic member reward map.
```

With:
```
--trace-network=DEBUG
```
we still see the full response.

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 6, 2020

Build failed

We now see:
```
[cardano-wallet.network:Info:65] [2020-07-06 15:07:56.63 UTC] Will query non-myopic rewards using the stake 100000000000
[cardano-wallet.network:Info:65] [2020-07-06 15:07:56.82 UTC] Fetched pool data from node tip using LSQ. Got 360 pools in the stake distribution, and 360 pools in the non-myopic member reward map.
```

With:
--trace-network=DEBUG
we still see the full response.
@Anviking Anviking force-pushed the anviking/less-verbose-pool-traces branch from 2a3115d to 8321139 Compare July 6, 2020 20:37
@Anviking
Copy link
Member Author

Anviking commented Jul 6, 2020

bors r+

iohk-bors bot added a commit that referenced this pull request Jul 6, 2020
1864: Less verbose LSQ pool response trace r=Anviking a=Anviking

# Overview

- [x] Log the full response as DEBUG, not INFO
- [x] Log the _size_ of the stake distribution and reward map as INFO 

# Comments

We now see:
```
[cardano-wallet.network:Info:65] [2020-07-06 15:07:56.63 UTC] Will query non-myopic rewards using the stake 100000000000
[cardano-wallet.network:Info:65] [2020-07-06 15:07:56.82 UTC] Fetched pool data from node tip using LSQ. Got 360 pools in the stake distribution, and 360 pools in the non-myopic member reward map.
```

With:
```
--trace-network=DEBUG
```
we still see the full response.

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Assign the PR to a corresponding milestone
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 6, 2020

Build failed

@Anviking
Copy link
Member Author

Anviking commented Jul 7, 2020

bors r+
should be manually restarted now

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jul 7, 2020

@iohk-bors iohk-bors bot merged commit a407180 into master Jul 7, 2020
@iohk-bors iohk-bors bot deleted the anviking/less-verbose-pool-traces branch July 7, 2020 15:59
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.

3 participants