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(tests): peer-exchange interop #1773

Merged
merged 7 commits into from
Jan 11, 2024

Conversation

danisharora099
Copy link
Collaborator

Problem

The current peer-exchange interop test does not correctly test the functionality

Solution

  • retrieve the multiaddr of the node discovered via peer-exchange
  • dial it
  • confirm the connection exists

@danisharora099 danisharora099 requested a review from a team as a code owner January 8, 2024 14:12
Copy link

github-actions bot commented Jan 8, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku core 82.02 KB (0%) 1.7 s (0%) 1.5 s (+41.2% 🔺) 3.1 s
Waku Simple Light Node 261.54 KB (0%) 5.3 s (0%) 2.9 s (-20.73% 🔽) 8.2 s
ECIES encryption 31.97 KB (0%) 640 ms (0%) 1.1 s (-2.1% 🔽) 1.7 s
Symmetric encryption 31.96 KB (0%) 640 ms (0%) 1.7 s (+133.89% 🔺) 2.3 s
DNS discovery 123.17 KB (0%) 2.5 s (0%) 1.7 s (-0.61% 🔽) 4.2 s
Privacy preserving protocols 119.34 KB (0%) 2.4 s (0%) 1.4 s (-47.66% 🔽) 3.8 s
Light protocols 79.56 KB (0%) 1.6 s (0%) 1.1 s (-4.4% 🔽) 2.6 s
History retrieval protocols 78.45 KB (0%) 1.6 s (0%) 1.7 s (+69.05% 🔺) 3.3 s
Deterministic Message Hashing 5.92 KB (0%) 119 ms (0%) 297 ms (-2.68% 🔽) 415 ms

@danisharora099 danisharora099 force-pushed the fix/peer-exchange-interop-test branch from 12b1a1d to 1ab3d58 Compare January 8, 2024 14:16
@danisharora099 danisharora099 marked this pull request as draft January 9, 2024 10:45
@danisharora099 danisharora099 force-pushed the fix/peer-exchange-interop-test branch from 37f070f to dca2f6e Compare January 9, 2024 11:47
@danisharora099 danisharora099 marked this pull request as ready for review January 9, 2024 11:54
@danisharora099 danisharora099 requested review from a team and weboko January 9, 2024 11:54
peerInfos.find(
({ ENR }) => ENR?.peerInfo?.id.toString() === nwaku1PeerId.toString()
) !== undefined;
peerInfos.find(({ ENR }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would not use .find in that case and would use .forEach since side effects important so that presence of foundNodePeerId is the result.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed it to use some which seems more appropriate & efficient

@danisharora099 danisharora099 requested a review from weboko January 10, 2024 12:26
@adklempner adklempner self-requested a review January 10, 2024 20:01
({ ENR }) => ENR?.peerInfo?.id.toString() === nwaku1PeerId.toString()
) !== undefined;
const foundNodeMultiaddrs: Multiaddr[] = [];
const foundNodePeerId: PeerId | undefined = undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

these values never get set, so that it will always throw at :87 and if not it will dial empty maddrs array

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

haha, you're right which is why the test failed as well. this caught in during the refactor from find to some -- addressed this -- thanks! :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

merging this PR now, let me know if you want to suggest any other change & I can follow up

@danisharora099 danisharora099 merged commit dc96074 into master Jan 11, 2024
9 of 11 checks passed
@danisharora099 danisharora099 deleted the fix/peer-exchange-interop-test branch January 11, 2024 11:09
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