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

skip returning error is an identity address on chain cannot be parsed #1136

Merged
merged 2 commits into from
Aug 13, 2021

Conversation

vishalchangrani
Copy link
Contributor

Canary network nodes are currently down because of the following error:

Aug 13 17:20:29 execution-001 docker[916872]: {"level":"fatal","node_role":"execution","node_id":"4beb93e69d8f3de3771336881b589330b1e1be7b0256467a36a1870855a2d828","error":"could not update approved peer list: could not generate address info: could not get translate identity to networking info 80514ec67dcd19a1000000000000000000000000000000000000000000000001: could not parse address ddba41333a7f7605ff0a5cd2d2966819c2c2aba71728826b5b10478dd49feec804a0eb063c3ffc2c55f76318f3f2386a181cbefbfb49495de2297bf5937a05ad: address ddba41333a7f7605ff0a5cd2d2966819c2c2aba71728826b5b10478dd49feec804a0eb063c3ffc2c55f76318f3f2386a181cbefbfb49495de2297bf5937a05ad: missing port in address","time":"2021-08-13T17:20:29Z","message":"failed to start middleware"}

There was some recent Flow port testing that was done which submitted an identity with an address which was missing the port field.

@@ -536,7 +536,7 @@ func (n *Node) UpdateAllowList(identities flow.IdentityList) error {
for i, identity := range identities {
allowlist[i], err = PeerAddressInfo(*identity)
if err != nil {
return fmt.Errorf("could not generate address info: %w", err)
n.logger.Err(err).Str("identity", identity.String()).Msg("could not generate address info")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not returning an error but rather logging it.

Copy link
Member

Choose a reason for hiding this comment

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

I think this would cause allowlist to have nil object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup, changed.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks.

Another comment is that I wonder if we could do this check earlier?

Since the validation of the peer address does not depend on any state, we could technically move the validation earlier. We just need to figure out the responsibility of who should validate the identity here. libp2p2? or overlay?

libp2p receives this list from overlay.Identity, should we let overlay filter out peers with invalid address?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, that is not a bad idea. @smnzhu is actually replacing the ids with an ID provider so I will add this validation over there.

@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2021

Codecov Report

Merging #1136 (06c3bcb) into master (c5109dd) will decrease coverage by 0.00%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1136      +/-   ##
==========================================
- Coverage   53.11%   53.11%   -0.01%     
==========================================
  Files         322      322              
  Lines       21829    21830       +1     
==========================================
  Hits        11594    11594              
- Misses       8662     8663       +1     
  Partials     1573     1573              
Flag Coverage Δ
unittests 53.11% <60.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
network/p2p/libp2pNode.go 63.98% <60.00%> (-0.23%) ⬇️

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 c5109dd...06c3bcb. Read the comment docs.

Copy link
Member

@Kay-Zee Kay-Zee left a comment

Choose a reason for hiding this comment

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

LGTM

@vishalchangrani
Copy link
Contributor Author

am deploying this on Canary (by backporting it to v0.20). Lemme know if you have any concerns.

@vishalchangrani vishalchangrani merged commit c2dd9e0 into master Aug 13, 2021
@vishalchangrani vishalchangrani deleted the vishal/fix_bad_addresses branch August 13, 2021 19:26
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.

None yet

4 participants