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: bug with GPRC client call through proxy #370

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

tegefaulkes
Copy link
Contributor

@tegefaulkes tegefaulkes commented Apr 6, 2022

Description

This PR is to address the issue with #369 and other small fixes.

This is basically the fix:

      this.tlsSocket.once('data', () => {
        this.serverSocket.pipe(this.tlsSocket as TLSSocket, { end: false });
      });

We couldn't get pause or cork to work. So now we only start piping the server socket to the tls socket on the reverse side upon first receiving data.

Issues Fixed

Tasks

  1. fix the RST_stream GRPC bug. Do this by delaying any response through the proxy till after we receive the MAGIC frame.
  2. Add in a check for handleConnectForward for the wild card addresses since they should not be connectable. - this could be done in Proxy.establishConnectionForward because it is used by both handleConnectForward and openConnectionForward, and it would throw a specific exception for this. Have a look at src/network/errors.ts to see what is acceptable.
  3. Add additional tests for this in Proxy.test.ts
  4. Ensure that NodeConnection.name is embedded in the NodeConnection logger.
  5. update logging in NodeConnectionManager to be less confusing when creating and using connections.
  6. test for if the proxy connections are established first and then client connects.

Final checklist

  • Domain specific tests
  • Full tests
  • Updated inline-comment documentation
  • Lint fixed
  • Squash and rebased
  • Sanity check the final build

@tegefaulkes tegefaulkes self-assigned this Apr 6, 2022
@CMCDragonkai
Copy link
Member

It turns out that networkUtils.resolvesZeroIP is used by network/Connection.ts to resolve zero IPs to localhost. This works, but all our logging gets confusing.

So to avoid future confusion, then we should just be preventing any usage of zero IP by using a isHostWildcard check can be done.

The question is where should this be done? During the construction of Connection or done also in the Proxy where connections are being opened forward and reverse and as well as via the CONNECT handler.

@tegefaulkes tegefaulkes force-pushed the GRPC_call_failure_fix branch 2 times, most recently from 9be8c35 to 516c193 Compare April 7, 2022 01:15
@tegefaulkes tegefaulkes marked this pull request as ready for review April 7, 2022 02:16
src/network/utils.ts Outdated Show resolved Hide resolved
@CMCDragonkai
Copy link
Member

@emmacasolin if you do the above simple fix, does it solve your problem from before?

@emmacasolin
Copy link
Contributor

@emmacasolin if you do the above simple fix, does it solve your problem from before?

I haven't tested it using namespaces yet, however @tegefaulkes has said that it fixes the case that we were using for testing before inside noNAT.test.ts #369 (comment)

@emmacasolin
Copy link
Contributor

@emmacasolin if you do the above simple fix, does it solve your problem from before?

I haven't tested it using namespaces yet, however @tegefaulkes has said that it fixes the case that we were using for testing before inside noNAT.test.ts #369 (comment)

Confirming that this fix also works for agents/seed nodes that are in different namespaces.

There was an issue in obscure conditions that caused certain packets to be out of the expected order for HTTP2 leading to a protocol error. This ensure that the `MAGIC` frame comes before the server's `SETTING` frame.

Updated `NodeConnectionManager` lifecycle logging.

`Proxy` and `NodeConnection` rejects connections to wildcard `0.0.0.0` and `::` addresses. Fixed up any tests broken by this change.

Added a test to check if you can connect to the target through the proxies after the proxies have created the UTP connection.

Fixes #369
@CMCDragonkai CMCDragonkai merged commit 3fe4b39 into master Apr 7, 2022
@CMCDragonkai CMCDragonkai deleted the GRPC_call_failure_fix branch April 7, 2022 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

GRPC call failure when multiple nodes connecting to 1 seed node.
3 participants