-
Notifications
You must be signed in to change notification settings - Fork 4
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
WIP: Fixing network issues in the new feature-dep-upgrades #376
WIP: Fixing network issues in the new feature-dep-upgrades #376
Conversation
@tegefaulkes this is where I'm investigating the network. |
Based off: #374 (comment) I don't think we should be cutting corners here regarding the networking, we should always ensure this is working well enough since it's the basis of all the other functionality of nodes and vaults. |
Attempting to revert the version of
The problem seems to be that GRPC extends some types provided by node. and given the new version of node GRPC isn't extending the type properly anymore. Specifically the This must've been the install/build errors that @emmacasolin saw. I don't really have any evidence for or against this version change being the problem however. |
Found one of the problems. For the 4 tests that have the write after end error. We can fix this by changing the following. tlsSocket.on('end', () => {
logger.debug('Reverse: receives tlsSocket ending');
tlsSocketEnd();
if (utpConn.destroyed) {
logger.debug('Reverse: destroys tlsSocket');
tlsSocket.destroy();
} else {
logger.debug('Reverse: responds tlsSocket ending');
// Why are we ending the tlsSocket during it's end event?
// tlsSocket.end(); // removing this removes the error.
utpConn.end(); // Seems like we should be ending the utpConn when the TLS ends.
tlsSocket.destroy();
}
}); |
The problem with the last test also seems to be a problem with the test itself. It seems to be caused by trying to connect to The fix for this is still the same. Just need to add the following to starting the proxy; await proxy.start({
serverHost: serverHost(),
serverPort: serverPort(),
forwardHost: localHost, // Add this
proxyHost: localHost, // Add this
tlsConfig: {
keyPrivatePem: keyPairPem.privateKey,
certChainPem: certPem,
},
}); Theses should be added to all of the other tests just in case. We only want to bind the the localhost for testing anyway. |
@CMCDragonkai What were you doing in the WIP commit? so I know how to rename or squash it out. |
8b96535
to
2d78e92
Compare
My original goal was to revert your changes to Then slowly reintroduce your changes as I can see incrementally what the effects are. Some of your changes was a bit confusing, especially removing lines of code that close/end sockets or other resources. I didn't finish it. |
Receiving an If it fails to send a FIN packet, then that's because the utp connection is destroyed. But as you can see I already checked for that. This is why I said it sounds familiar, since it's like a problem we have dealt with before. |
2d78e92
to
2f11571
Compare
2f11571
to
26173b8
Compare
Should be close to merging. There is some things I need to check first. |
Looking over how Proxy handles the |
It was just a problem with trying to connect to '0.0.0.0' with the UTP socket.
26173b8
to
ac7b8dd
Compare
This is ready to merge now. |
I think you should be logging out a warning here. If you're happy to proceed, just merge it into #374. I'll come back around to reviewing the networking issue soon. Main important thing is to code to the protocol, and add adjustments when the implementation doesn't meet the protocol. The utp-native library seems flaky atm, and assuming SI transaction works well enough, we may be in a position of integrating a different network stack like QUIC #234 (as I'll have the understanding and tooling for integrating C/C++ code into our JS libraries). |
Experiment in fixing the network