Skip to content

Commit

Permalink
Merge #1630 #1633
Browse files Browse the repository at this point in the history
1630: Reduce logging from network layer r=rvl a=rvl

### Issue Number

Relates to #1577 / ADP-83.

### Overview

- Set network tip log level to debug
- Improve formatting of text log message
- Only log the tip when it changes, because the node can seem to send updates when nothing changes

### Comments

This is what it looks like now:

```
[cardano-wallet.network:Debug:18] [2020-05-06 07:49:54.10 UTC] Network node tip block height is 4125310 at hash c5cb3bcd
```


1633: review RELEASE_TEMPLATE to constuct changelog from PR + labels r=rvl a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

N/A

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

We used to organize the CHANGELOG by milestones, but we are now organizing it by 'type of change' (improvement, bug fix, addition). Therefore, the current thing called CHANGELOG is redundant with the other. I've tweaked the 'make_changelog' script to build a changelog according to these categories, provided that PR were labelled accordingly.



# Comments

<!-- 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: Rodney Lorrimar <[email protected]>
Co-authored-by: Matthias Benkort <[email protected]>
Co-authored-by: KtorZ <[email protected]>
  • Loading branch information
4 people authored May 7, 2020
3 parents 6ef89c3 + 46b07c0 + 70a8f7e commit a021622
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 42 deletions.
10 changes: 10 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,13 @@ steps:
system: x86_64-linux
soft_fail:
- exit_status: '*'

- label: 'Prevent merging to wrong branch'
if: 'build.branch == "bors/staging" && build.pull_request.base_branch != "master"'
command:
- 'echo "Refusing to merge into $BUILDKITE_PULL_REQUEST_BASE_BRANCH."'
- 'echo "You should only use bors to merge into master."'
- 'echo "Either change the PR base branch to master, or merge manually."'
- 'exit 1'
agents:
system: x86_64-linux
30 changes: 9 additions & 21 deletions .github/RELEASE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,20 @@

Compatible with [`jormungandr@{{JORM_TAG}}`](https://github.com/input-output-hk/jormungandr/releases/tag/{{JORM_TAG}}) and [`cardano-node@{{CARDANO_NODE_TAG}}`](https://github.com/input-output-hk/cardano-node/releases/tag/{{CARDANO_NODE_TAG}}).

<!-- A CHANGELOG, organized in three sections:
- New Features
- Improvements
- Resolved Issues
## New Features
-->

## Improvements

## Resolved Issues

<!-- Fixes included in this release that were present in the previous release -->
{{CHANGELOG}}

## Known Issues

<!-- Bugs known at the moment of the release, or discovered after and not fixed -->

## Changelog


<!-- A CHANGELOG, organized in milestones. Ideally, we put it within
some <details></details> elements to avoid cluttering the release notes -->

{{CHANGELOG}}


## Weekly Reports

- [Week 12 - 2020-03-20](https://github.com/input-output-hk/cardano-wallet/tree/weekly-reports/2020-03-20)

## Documentation

<!-- A snapshot of the documentation at the time of releasing. -->
Expand Down Expand Up @@ -57,7 +45,7 @@ the moment of releasing. -->

#### Docker

Pull from DockerHub and verify version.
Pull from DockerHub and verify the version matches {{CABAL_VERSION}}

```
$ docker pull inputoutput/cardano-wallet:{{CABAL_VERSION}}-jormungandr
Expand All @@ -76,7 +64,7 @@ $ docker run --rm inputoutput/cardano-wallet:{{CABAL_VERSION}}-jormungandr versi

#### Docker

Pull from DockerHub and verify version.
Pull from DockerHub and verify the version matches {{CABAL_VERSION}}.

```
$ docker pull inputoutput/cardano-wallet:{{CABAL_VERSION}}-byron
Expand Down
26 changes: 16 additions & 10 deletions lib/byron/src/Cardano/Wallet/Byron/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import Cardano.Chain.Byron.API
( ApplyMempoolPayloadErr (..) )
import Cardano.Wallet.Byron.Compatibility
( Byron
, fromByronHash
, fromChainHash
, fromSlotNo
, fromTip
Expand Down Expand Up @@ -147,7 +148,8 @@ import Ouroboros.Consensus.Byron.Node
import Ouroboros.Consensus.Node.Run
( RunNode (..) )
import Ouroboros.Network.Block
( Point (..)
( BlockNo (..)
, Point (..)
, Serialised (..)
, SlotNo (..)
, Tip (..)
Expand Down Expand Up @@ -481,11 +483,6 @@ mkTipSyncClient tr localTxSubmissionQ onTipUpdate onTxParamsUpdate = do
onTxParamsUpdate txParams

let
onTipUpdate' tip = do
traceWith tr $ MsgNodeTip tip
onTipUpdate tip
queryLocalState (getTipPoint tip)

queryLocalState pt =
(localStateQueryQ `send` CmdQueryLocalState pt) >>= handleLocalState

Expand All @@ -497,6 +494,11 @@ mkTipSyncClient tr localTxSubmissionQ onTipUpdate onTxParamsUpdate = do
Right (Right ls) ->
onTxParamsUpdate' $ txParametersFromUpdateState ls

onTipUpdate' <- debounce $ \tip -> do
traceWith tr $ MsgNodeTip tip
onTipUpdate tip
queryLocalState (getTipPoint tip)

pure $ nodeToClientProtocols NodeToClientProtocols
{ localChainSyncProtocol =
InitiatorProtocolOnly $ MuxPeerRaw $ \channel ->
Expand Down Expand Up @@ -1047,9 +1049,13 @@ instance ToText NetworkLayerLog where
]
MsgLocalStateQuery msg ->
T.pack (show msg)
MsgNodeTip tip -> T.unwords
[ "Network node tip is:"
, T.pack (show tip)
MsgNodeTip TipGenesis ->
"Network node tip is at genesis"
MsgNodeTip (Tip _sl h (BlockNo bl)) -> T.unwords
[ "Network node tip block height is"
, T.pack (show bl)
, "at hash"
, pretty (fromByronHash h)
]
MsgTxParameters params -> T.unwords
[ "TxParams for tip are:"
Expand All @@ -1074,6 +1080,6 @@ instance HasSeverityAnnotation NetworkLayerLog where
MsgIntersectionFound{} -> Info
MsgPostSealedTx{} -> Debug
MsgLocalStateQuery{} -> Debug
MsgNodeTip{} -> Info
MsgNodeTip{} -> Debug
MsgTxParameters{} -> Info
MsgLocalStateQueryError{} -> Error
32 changes: 21 additions & 11 deletions scripts/make_changelog
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,36 @@ REPO="input-output-hk/cardano-wallet"
: ${GITHUB_API_TOKEN?"Please provide a Github Api Token for fetching pull requests"}

PULL_REQUESTS=$(curl -X GET \
-H "Authorization: token $GITHUB_API_TOKEN" \
-H "Authorization: token $API_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/search/issues?per_page=500\&q=repo:$REPO+is:pr+is:merged+merged:%3E$1)

PULL_REQUESTS=$(echo $PULL_REQUESTS | jq '.items | map({number:.number,title:.title,milestone:.milestone.title}) | group_by(.milestone)')
PULL_REQUESTS=$(echo $PULL_REQUESTS | jq '.items | map({number:.number,title:.title,label:.labels[0].name}) | group_by(.label)')
ITEMS=$(echo $PULL_REQUESTS | jq 'map(map("#\(.number) | \(.title)"))')
MILESTONES=$(echo $PULL_REQUESTS | jq 'map(map("\(.milestone)") | unique) | flatten')
I=($(echo $MILESTONES | jq 'length - 1'))
LABELS=$(echo $PULL_REQUESTS | jq 'map(map("\(.label)") | unique) | flatten')
I=($(echo $LABELS | jq 'length - 1'))

for i in $(seq 0 $I); do
MILESTONE=$(echo $MILESTONES | jq -r ".[$i]")
echo "<details>"
echo " <summary>$MILESTONE</summary>"
LABEL=$(echo $LABELS | jq -r ".[$i]")
case $LABEL in
"null")
echo "## Unclassified"
;;
"ADDING FEATURE")
echo "## New Features"
;;
"IMPROVING CODE")
echo "## Improvements"
;;
"RESOLVING ISSUE")
echo "## Resolved Issues"
;;
esac
echo ""
echo "PR | Description"
echo "-- | --"
J=($(echo $ITEMS | jq ".[$i] | length - 1"))
for j in $(seq 0 $J); do
LINE=$(echo $ITEMS | jq -r ".[$i] | .[$j]")
echo "$LINE"
echo "- $LINE"
done
echo "</details>"
echo ""
done

0 comments on commit a021622

Please sign in to comment.