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

refactor(core-p2p): dont dump the reply when /peer/list validation fails #2215

Merged
merged 1 commit into from
Mar 9, 2019
Merged

Conversation

spkjp
Copy link
Contributor

@spkjp spkjp commented Mar 9, 2019

Proposed changes

[INFO]: Fetching a fresh peer list from http://185.170.115.40:4002
[ERROR]: Got unexpected reply from http://185.170.115.40:4002/peer/list: child "peers" fails because ["peers" at position 1 fails because [child "ip" fails because ["ip" must be a valid ip address with a forbidden CIDR]]] - ip: 2130706433

vs

[INFO]: Fetching a fresh peer list from http://185.170.115.40:4002
[ERROR]: Got unexpected reply from http://185.170.115.40:4002/peer/list: 
{"success":true,"peers":[{"ip":"2130706435","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","milestoneHash":"3b7ee0793e2ddf23","version":"2.1.0","os":"linux","status":200,
    "height":1571996,"delay":3,"hashid":"fb0491af"},{"ip":"2130706433","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","milestoneHash":"3b7ee0793e2ddf23","version":"2.1.0","os":"linux","status":200,
    "height":1571996,"delay":43,"hashid":"fb0491af"},{"ip":"2130706434","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","milestoneHash":"3b7ee0793e2ddf23","version":"2.1.0","os":"linux","status":200,
    "height":1571996,"delay":43,"hashid":"fb0491af"},{"ip":"localhost","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","milestoneHash":"3b7ee0793e2ddf23","version":"2.1.0","os":"linux","status":200,
    "height":1571996,"delay":48,"hashid":"fb0491af"},{"ip":"2130706436","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","milestoneHash":"3b7ee0793e2ddf23","version":"2.1.0","os":"linux","status":200,
    "height":1571996,"delay":48,"hashid":"fb0491af"},{"ip":"94.16.113.187","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","milestoneHash":"3b7ee0793e2ddf23","version":"2.1.0","os":"linux","status":200,
    "height":1264592,"delay":68,"hashid":"1c254aa0"},{"ip":"185.170.115.40","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","milestoneHash":"3b7ee0793e2ddf23","version":"2.1.0","os":"linux","status":200,
    "height":1274218,"delay":70,"hashid":"1c254aa0"},{"ip":"37.59.70.165","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":84,"hashid":"a3a98837"},{"ip":"213.32.9.98","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":91,"hashid":"a3a98837"},{"ip":"213.32.9.97","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":91,"hashid":"a3a98837"},{"ip":"167.114.29.43","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720060,"delay":209,"hashid":"a3a98837"},{"ip":"167.114.29.53","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720060,"delay":209,"hashid":"a3a98837"},{"ip":"167.114.43.33","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720059,"delay":216,"hashid":"a3a98837"},{"ip":"167.114.29.47","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":235,"hashid":"a3a98837"},{"ip":"167.114.29.33","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":239,"hashid":"a3a98837"},{"ip":"167.114.43.38","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":239,"hashid":"a3a98837"},{"ip":"167.114.29.45","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":239,"hashid":"a3a98837"},{"ip":"167.114.29.42","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":240,"hashid":"a3a98837"},{"ip":"167.114.29.37","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":240,"hashid":"a3a98837"},{"ip":"167.114.43.34","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":240,"hashid":"a3a98837"},{"ip":"167.114.29.38","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":240,"hashid":"a3a98837"},{"ip":"167.114.43.36","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":241,"hashid":"a3a98837"},{"ip":"167.114.29.40","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":241,"hashid":"a3a98837"},{"ip":"167.114.43.42","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":241,"hashid":"a3a98837"},{"ip":"167.114.29.50","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":241,"hashid":"a3a98837"},{"ip":"167.114.43.40","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":242,"hashid":"a3a98837"},{"ip":"167.114.43.41","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":242,"hashid":"a3a98837"},{"ip":"167.114.29.34","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":242,"hashid":"a3a98837"},{"ip":"167.114.29.55","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":242,"hashid":"a3a98837"},{"ip":"167.114.29.60","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":243,"hashid":"a3a98837"},{"ip":"167.114.43.37","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":243,"hashid":"a3a98837"},{"ip":"167.114.29.41","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":244,"hashid":"a3a98837"},{"ip":"167.114.29.51","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":244,"hashid":"a3a98837"},{"ip":"167.114.29.36","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":244,"hashid":"a3a98837"},{"ip":"167.114.29.58","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":244,"hashid":"a3a98837"},{"ip":"167.114.43.39","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":245,"hashid":"a3a98837"},{"ip":"167.114.43.43","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":245,"hashid":"a3a98837"},{"ip":"167.114.29.46","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":245,"hashid":"a3a98837"},{"ip":"167.114.29.57","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":245,"hashid":"a3a98837"},{"ip":"167.114.29.54","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":245,"hashid":"a3a98837"},{"ip":"167.114.29.59","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":246,"hashid":"a3a98837"},{"ip":"167.114.29.44","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":246,"hashid":"a3a98837"},{"ip":"167.114.29.39","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":246,"hashid":"a3a98837"},{"ip":"167.114.29.56","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":246,"hashid":"a3a98837"},{"ip":"167.114.29.49","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":247,"hashid":"a3a98837"},{"ip":"167.114.29.61","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":247,"hashid":"a3a98837"},{"ip":"167.114.29.48","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":247,"hashid":"a3a98837"},{"ip":"167.114.29.52","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":248,"hashid":"a3a98837"},{"ip":"167.114.43.35","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":248,"hashid":"a3a98837"},{"ip":"167.114.29.35","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":249,"hashid":"a3a98837"},{"ip":"138.197.79.32","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":258,"hashid":"3bfaff3f"},{"ip":"167.114.43.44","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720052,"delay":362,"hashid":"a3a98837"},{"ip":"167.114.43.46","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720060,"delay":362,"hashid":"a3a98837"},{"ip":"167.114.43.49","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720052,"delay":363,"hashid":"a3a98837"},{"ip":"104.223.26.36","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","milestoneHash":"3b7ee0793e2ddf23","version":"2.1.2","os":"linux","status":200,
    "height":1720051,"delay":364,"hashid":"6c847f7f"},{"ip":"167.114.43.52","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720052,"delay":366,"hashid":"a3a98837"},{"ip":"167.114.43.48","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":392,"hashid":"a3a98837"},{"ip":"167.114.43.45","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":396,"hashid":"a3a98837"},{"ip":"167.114.43.50","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":397,"hashid":"a3a98837"},{"ip":"167.114.43.53","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":397,"hashid":"a3a98837"},{"ip":"167.114.43.47","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":399,"hashid":"a3a98837"},{"ip":"167.114.43.51","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720051,"delay":401,"hashid":"a3a98837"},{"ip":"167.114.43.54","port":4002,"nethash":"2a44f340d76ffc3df204c5f38cd355b7496c9065a1ade2ef92071436bd72e867","version":"2.2.0","os":"linux","status":200,
    "height":1720059,"delay":2581,"hashid":"a3a98837"}]}: child "peers" fails because ["peers" at position 0 fails because [child "ip" fails because ["ip" must be a valid ip address with a forbidden CIDR]]]

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improve a current implementation without adding a new feature or fixing a bug)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build (changes that affect the build system)
  • Docs (documentation only changes)
  • Test (adding missing tests or fixing existing tests)
  • Other... Please describe:

Checklist

  • I have read the CONTRIBUTING documentation
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@ghost
Copy link

ghost commented Mar 9, 2019

The ci/circleci: test-node10-1 job is failing as of d77590f624bcb9a7be110e96f9091f3a33a70fe4. Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

1 similar comment
@ghost
Copy link

ghost commented Mar 9, 2019

The ci/circleci: test-node10-1 job is failing as of d77590f624bcb9a7be110e96f9091f3a33a70fe4. Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

@codecov-io
Copy link

codecov-io commented Mar 9, 2019

Codecov Report

Merging #2215 into 2.2 will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.2    #2215      +/-   ##
==========================================
+ Coverage   79.23%   79.24%   +0.01%     
==========================================
  Files         331      331              
  Lines        7916     7920       +4     
  Branches     1115     1092      -23     
==========================================
+ Hits         6272     6276       +4     
  Misses       1612     1612              
  Partials       32       32
Impacted Files Coverage Δ
packages/core-p2p/src/peer.ts 85.41% <100%> (+0.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0359c09...d77590f. Read the comment docs.

@faustbrian faustbrian merged commit 7a76aa5 into ArkEcosystem:2.2 Mar 9, 2019
vasild added a commit that referenced this pull request Mar 11, 2019
* ArkEcosystem/core/develop:
  chore: update dependencies and remove unused imports (#2212)
  fix(core-tester-cli): Don't hide errors from HTTP failures (#2223)
  chore: update CircleCI config
  chore: use yarn setup on CircleCI
  fix: resolve core-tester-utils conflicts and various errors
  chore: yarn.lock
  chore: bump versions
  chore: resolve conflicts
  refactor(core): allow to provide yes/no callbacks for confirm
  feat(core): suggest another command if the requested one was not found
  fix(core): only quote string flags that contain whitespace
  fix(core-blockchain): node stuck during sync  (#2220)
  docs: add #2217 to the changelog
  refactor(core): use restart instead of reload
  refactor(core): log the stderr output for pm2 errors
  refactor(core): handle pm2 errors outside of the process manager
  refactor(core): log the pm2 status if it is unknown
  refactor(core-p2p): log concise error message instead of dumping the reply (#2215)
  fix(core-blockchain): return if last downloaded block changed (#2216)
  fix(core-transaction-pool): invalid transactions after rollback (#2217)
  feat(core-p2p): Don't spoil the quorum if the peer has !forgingAllowed (#2214)
  fix(core): escape string flags
  docs: add #2207 to the changelog
  refactor(core-forger): Increase timeout for getting the network state (#2208)
  fix: vote balance update (#2207)
  fix(core): exclude undefined values from string casting
  build(docker): use latest release in production images
  chore: install stable release via setup script
  test(core-p2p): toBeGreaterThanOrEqual instead of toBe
  release: 2.2.0
  chore: bump version
  fix: schema
  fix: max payload size
  fix: quorum issues (#2091)
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