-
-
Notifications
You must be signed in to change notification settings - Fork 89
Bounty: $300 for Fixing js-libp2p Compatibility Issues in react-native-tcp-socket #209
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
Comments
Update: For anyone interested in taking on this bounty, I can make payments via Bitcoin, USDT, Zelle, or CashApp. Let me know if you have any questions! |
@palmtown we can help you streamline your bounty and make it visible to more developers, can you reach out to me via email (yours is not visible on your profile)? |
Thanks for reaching out. Note that I sent you an email. Looking forward to getting this in front of interested developers. |
🚀 Bounty Alert!💰 A bounty of $300.00 has been created by palmtown on BountyHub for this issue. 🔗 Claim this bounty by submitting a pull request that solves this issue! You can also increase the amount of the bounty if you think the issue is worth more. Good luck, and happy coding! 💻 |
Hi @palmtown |
Hello @Myestery, Thanks for your interest in this bounty! I appreciate you looking into it. When you’ve had a chance to review the requirements, could you provide a rough estimate of the timeline? This will help me understand whether we’re looking at days or months for completion. I’ve sent you a LinkedIn message with my email address for further communication. Looking forward to your thoughts! |
If it helps someone, the connection failure log line:
...normally means that the remote closed the connection during opening. The thing to do would be to check the logs on the remote node to find out why it closed the connection. |
okay, this is helpful |
I can send a PR to fix it on or before Monday but I'm currently investigating it |
let me deep dive |
for reference - https://github.com/nodejs/node/blob/main/lib/net.js |
I created a PR in #210 that should fix this, the tests ensure that the fix is also backward compatible for those who use the library |
I tested the PR, react-native-tcp-socket side issue is cleared but i could not dial relay server. facing the following error when try to dial
this time issue with libp2p-js side? |
I'll like to see the code you ran but yeah, this error is not from this library |
[NoValidAddressesError: The dial request has no valid addresses] this error occurred because i try to dial wrong address(websocket multi addresss) now i change to tcp address this error gone. |
great, looks like we're good to go 🚀 |
but i could not dial. it is not responding |
Hello @Myestery Thanks for getting this done. It is much appreciated. I will check it today and let you know my findings. |
Thanks for testing! We're you able to get it to work as expected. If not, what issues did you face? |
i need to check again. is it work for you? |
Hello @Myestery Thank you once again for your efforts on this issue. After reviewing your pull request, I have the following observations: Acceptance Criterion #2: The pull request does not fully address "fix connection failures when a React Native client dials a relay: Ensure that React Native clients can successfully establish connections with relays without encountering errors such as UnexpectedEOFError." I have included additional logs from the relay, as suggested by @achingbrain, in Exhibit 1 below. If your pull request addresses this issue, could you please specify which parts of your code pertain to this fix? Acceptance Criterion #1: Regarding Acceptance Criterion #1, you mentioned:
While the type definitions for allowHalfOpen and pauseOnConnect are present, they do not appear to be supported, and passing these options seems to have no effect. Although implementing support for allowHalfOpen and pauseOnConnect is not required for this pull request—since libp2p doesn't seem to utilize these options—please consider adding support for them if you find it necessary to fulfill the acceptance criteria. Otherwise, they are not required. If you have a working example of react-native-tcp-socket and js-libp2p functioning together, please share the repository, and I will review it. In the meantime, I kindly ask you to address the points mentioned above. Exhibit 1 Exhibit 1 - Image |
@palmtown can you please share the repo to test? |
Hi @palmtown |
Hello @Myestery, Thank you for your efforts on this fix. I appreciate the work you've put in. I noticed that AC 2 specifies that a React Native client should be able to dial a relay without errors, and I'm a little unsure about the testing details used to confirm this. My testing has been part of a larger integrated app, so I don’t have a standalone repo ready to share. Could you please provide the repo you used to test this fix or how you verified that the issue is resolved? This will help us ensure that all criteria are fully met. |
I created a test repo for testing libp2p tcp for react-native - https://github.com/abuvanth/react-native-libp2p-tcp-test |
Hi @palmtown, for now I used the tests in the library to test the functionality but I'll take a further step with @abuvanth 's repo now to investigate further and get back. |
Hello @Myestery, How are you doing? I wanted to check in on the progress of this fix. Are there any challenges or blockers you're encountering? Thanks! |
Hi @palmtown |
I am trying to centralized all improvements, I have already proposed a PR #208 where I have also included a fix about timeout and I will propose a new PR where I fix some exceptions not caught (for instance when there is a SSL certificate error an error is not emitted). |
your PR is not fix following
|
Can you give me more context...which listener ? what modification ? |
read the issue description of this thread |
You don't understand my PR is not supposed to fix this, since I am working on something else. I am just saying we need to centralize improvements. |
Background
js-libp2p is the JavaScript implementation of the libp2p networking stack, enabling peer-to-peer communication with modular transport, discovery, and security protocols. Integrating it with React Native is critical for decentralized applications, allowing mobile clients to connect to peer networks without relying on centralized servers.
Currently, react-native-tcp-socket, which serves as a TCP transport layer in React Native, faces compatibility issues with js-libp2p. Fixing these issues will not only enable seamless connectivity for libp2p-based applications on mobile but also improve react-native-tcp-socket by bringing it closer to Node.js's net implementation, ensuring long-term maintainability and broader adoption.
Bounty Details
I am offering $300 to the developer who successfully creates a PR addressing the following:
Tasks
Acceptance Criteria (AC)
✅ Issue #183 is resolved.
✅ A React Native client can successfully dial a bootstrap/relay/peer without connection failures.
✅ A pull request (PR) is created with the fixes.
If you need assistance testing, I am happy to help by setting up a reproducible repository.
Exhibit 2: Connection Failure Log
libp2p:tcp:socket:error encrypting inbound connection from /ip4/X.X.X.X/tcp/58057 failed UnexpectedEOFError: unexpected end of input
at Object.read (file:///home/nodejs/libp2p/node_modules/it-byte-stream/dist/src/index.js:94:31)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Object.read (file:///home/nodejs/libp2p/node_modules/it-length-prefixed-stream/dist/src/index.js:45:37)
at async read (file:///home/nodejs/libp2p/node_modules/@libp2p/multistream-select/dist/src/multistream.js:22:17)
at async Module.readString (file:///home/nodejs/libp2p/node_modules/@libp2p/multistream-select/dist/src/multistream.js:33:17)
at async Module.handle (file:///home/nodejs/libp2p/node_modules/@libp2p/multistream-select/dist/src/handle.js:63:26)
at async DefaultUpgrader._encryptInbound (file:///home/nodejs/libp2p/node_modules/libp2p/dist/src/upgrader.js:458:42)
at async DefaultUpgrader._performUpgrade (file:///home/nodejs/libp2p/node_modules/libp2p/dist/src/upgrader.js:173:21)
at async DefaultUpgrader.upgradeInbound (file:///home/nodejs/libp2p/node_modules/libp2p/dist/src/upgrader.js:99:13) {
code: 'ERR_UNEXPECTED_EOF'
How This Helps the Future of react-native-tcp-socket
By resolving these issues, react-native-tcp-socket will better align with Node.js's net module, making it a more reliable and future-proof solution for TCP networking in React Native. This improvement is essential for decentralized applications, Web3 projects, and any use case requiring peer-to-peer communication on mobile.
If you're up for the challenge, submit your PR and claim the bounty! 🚀 Please feel free to reach out to me with any questions.
@achingbrain
@abuvanth
The text was updated successfully, but these errors were encountered: