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

Use INodeAddress type in message handling #693

Merged
merged 6 commits into from
Dec 18, 2024
Merged

Use INodeAddress type in message handling #693

merged 6 commits into from
Dec 18, 2024

Conversation

ScottyPoi
Copy link
Collaborator

@ScottyPoi ScottyPoi commented Dec 17, 2024

Fixes issue caused by #682 / #684

Message handling must use INodeAddress type, since onTalkRequest events from discv5 do not always contain an ENR.

All network message handlers were updated to use INodeAddress, which is all that is needed for sendTalkResponse.


This gets a little tricky when a new uTP request is created. All uTP messages happen via talkReq, which requires an ENR to send. However, there are times when the uTP request needs to be instantiated before the peer's ENR has become available. So a new uTP request can be created using either INodeAddress or ENR. In cases where we use the INodeAddress, we optimistically hope that by the time we need to send the first uTP packet, the peer's ENR has become available.

@ScottyPoi
Copy link
Collaborator Author

note: the last commit 56dfc59, is a temporary patch for code that is currently getting refactored in a separate open PR.

Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

LGTM

@acolytec3 acolytec3 merged commit b1e7850 into master Dec 18, 2024
5 checks passed
@acolytec3 acolytec3 deleted the nodeaddress branch December 18, 2024 01:06
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.

2 participants