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

fix: PeerExchange rpc decode in order not to take response's status_code mandatory - for support old protocol implementation #3059

Merged

Conversation

NagyZoltanPeter
Copy link
Contributor

Description

lite-protocol-tester implementation started using PX from the receiver side and found that node that implements old style PeerExchange protocol does not containing status_code and status_desc can cause decode failure.
To handle this false assumption of making status_code for response mandatory, if not included the value is derived from the response enr list length.

+1
I found that PeerExchange tries to aggressively fill the ENR cache at startup. It takes a minimum 60 Peers to fill in the cache. But if there is not many this loop will run - async - till end of program at every 5.secs, instead of running at every 10 minutes as designed.
So to break the loop I added a max 10 times trial of aggressive filling.

Changes

  • PeerExchange rpc_codec - to derive status_code value if not included in the protobuf payload
  • PeerExchange protocol initial ENR cache fill limited to 10 trials.

…de mandatory - for support old protocol implementation
Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3059

Built from 37b7e05

@NagyZoltanPeter NagyZoltanPeter changed the title fix:PeerExchange rpc decode in order not to take response's status_code mandatory - for support old protocol implementation fix: PeerExchange rpc decode in order not to take response's status_code mandatory - for support old protocol implementation Sep 25, 2024
@NagyZoltanPeter NagyZoltanPeter merged commit 5afa9b1 into release/v0.33 Sep 25, 2024
12 of 14 checks passed
@NagyZoltanPeter NagyZoltanPeter deleted the fix-px-response-no-status-code-mandatory branch September 25, 2024 09:51
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