Skip to content

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

Merged
NagyZoltanPeter merged 1 commit intorelease/v0.33from
fix-px-response-no-status-code-mandatory
Sep 25, 2024
Merged

fix: PeerExchange rpc decode in order not to take response's status_code mandatory - for support old protocol implementation#3059
NagyZoltanPeter merged 1 commit intorelease/v0.33from
fix-px-response-no-status-code-mandatory

Conversation

@NagyZoltanPeter
Copy link
Copy Markdown
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
Copy Markdown
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!

@github-actions
Copy link
Copy Markdown

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
@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