Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Rephrase error messages in EthereumPeer::validate and re-order validation conditions #5559

Merged
merged 4 commits into from
Apr 11, 2019

Conversation

halfalicious
Copy link
Contributor

@halfalicious halfalicious commented Apr 11, 2019

Fix #5554

Rephrase the error messages in EthereumPeer::validate so that they are more descriptive and contain the peer and host values. Also order the validation conditions from broadest (network ID) to most targeted (unexpected status message) so that the sync logs are easier to read.

Reorder validation so that checks go from the broadest condition (network ID) to the most targeted (unexpected status message) - also rephrase log messages and include host / peer values. The result is that the logs are easier to read and contain more useful information.
Also move static constant to anonymous namespace
@halfalicious halfalicious requested review from gumb0 and chfast and removed request for gumb0 April 11, 2019 04:19
CHANGELOG.md Outdated Show resolved Hide resolved
@codecov-io
Copy link

Codecov Report

Merging #5559 into master will increase coverage by <.01%.
The diff coverage is 8.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5559      +/-   ##
==========================================
+ Coverage   62.16%   62.17%   +<.01%     
==========================================
  Files         347      347              
  Lines       28968    28975       +7     
  Branches     3281     3281              
==========================================
+ Hits        18008    18015       +7     
- Misses       9782     9785       +3     
+ Partials     1178     1175       -3

@chfast chfast merged commit 60fbc2f into master Apr 11, 2019
@chfast chfast deleted the sync-status-checks branch April 11, 2019 08:50
error << "Protocol version mismatch. Host protocol version: " << _hostProtocolVersion
<< ", peer protocol version: " << m_protocolVersion;
else if (m_genesisHash != _hostGenesisHash)
error << "Genesis hash mismatch. Host genesis hash: " << _hostGenesisHash
Copy link
Member

Choose a reason for hiding this comment

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

Too bad this doesn't use operator<< overloads for logging, so it outputs long full hash. Maybe change it to outputting .abridged() ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants