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

ci: merge staging to master #854

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polykey",
"version": "1.16.4",
"version": "1.17.0",
"homepage": "https://polykey.com",
"author": "Matrix AI",
"contributors": [
Expand Down Expand Up @@ -78,7 +78,7 @@
"@matrixai/id": "^3.3.6",
"@matrixai/logger": "^3.1.2",
"@matrixai/mdns": "^1.2.6",
"@matrixai/quic": "^1.3.1",
"@matrixai/quic": "^1.3.2",
"@matrixai/resources": "^1.1.5",
"@matrixai/rpc": "^0.6.2",
"@matrixai/timer": "^1.1.3",
Expand Down
10 changes: 10 additions & 0 deletions src/PolykeyAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ type PolykeyAgentOptions = {
connectionKeepAliveTimeoutTime: number;
connectionKeepAliveIntervalTime: number;
connectionHolePunchIntervalTime: number;
connectionInitialMaxStreamsBidi: number;
connectionInitialMaxStreamsUni: number;
rpcCallTimeoutTime: number;
rpcParserBufferSize: number;
dnsServers: Array<string> | undefined;
Expand Down Expand Up @@ -196,6 +198,10 @@ class PolykeyAgent {
config.defaultsSystem.nodesConnectionKeepAliveIntervalTime,
connectionHolePunchIntervalTime:
config.defaultsSystem.nodesConnectionHolePunchIntervalTime,
connectionInitialMaxStreamsBidi:
config.defaultsSystem.nodesConnectionInitialMaxStreamsBidi,
connectionInitialMaxStreamsUni:
config.defaultsSystem.nodesConnectionInitialMaxStreamsUni,
},
mdns: {
groups: config.defaultsSystem.mdnsGroups,
Expand Down Expand Up @@ -374,6 +380,10 @@ class PolykeyAgent {
optionsDefaulted.nodes.connectionKeepAliveIntervalTime,
connectionHolePunchIntervalTime:
optionsDefaulted.nodes.connectionHolePunchIntervalTime,
connectionInitialMaxStreamsBidi:
optionsDefaulted.nodes.connectionInitialMaxStreamsBidi,
connectionInitialMaxStreamsUni:
optionsDefaulted.nodes.connectionInitialMaxStreamsBidi,
rpcParserBufferSize: optionsDefaulted.nodes.rpcParserBufferSize,
rpcCallTimeoutTime: optionsDefaulted.nodes.rpcCallTimeoutTime,
logger: logger.getChild(NodeConnectionManager.name),
Expand Down
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ const config = {
* Interval for hole punching reverse node connections.
*/
nodesConnectionHolePunchIntervalTime: 1_000, // 1 second
nodesConnectionInitialMaxStreamsBidi: 1_000,
nodesConnectionInitialMaxStreamsUni: 0, // We don't use unidirectional streams so we disable them

/**
* Interval for refreshing buckets.
*
Expand Down
14 changes: 14 additions & 0 deletions src/nodes/NodeConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ class NodeConnection {
connectionKeepAliveIntervalTime,
connectionKeepAliveTimeoutTime = config.defaultsSystem
.nodesConnectionIdleTimeoutTimeMin,
connectionInitialMaxStreamsBidi = config.defaultsSystem
.nodesConnectionInitialMaxStreamsBidi,
connectionInitialMaxStreamsUni = config.defaultsSystem
.nodesConnectionInitialMaxStreamsUni,
quicSocket,
manifest,
logger,
Expand All @@ -182,6 +186,8 @@ class NodeConnection {
tlsConfig: TLSConfig;
connectionKeepAliveIntervalTime?: number;
connectionKeepAliveTimeoutTime?: number;
connectionInitialMaxStreamsBidi?: number;
connectionInitialMaxStreamsUni?: number;
quicSocket?: QUICSocket;
manifest: AgentClientManifest;
logger?: Logger;
Expand All @@ -203,6 +209,10 @@ class NodeConnection {
connectionKeepAliveIntervalTime,
connectionKeepAliveTimeoutTime = config.defaultsSystem
.nodesConnectionIdleTimeoutTimeMin,
connectionInitialMaxStreamsBidi = config.defaultsSystem
.nodesConnectionInitialMaxStreamsBidi,
connectionInitialMaxStreamsUni = config.defaultsSystem
.nodesConnectionInitialMaxStreamsUni,
quicSocket,
logger = new Logger(this.name),
}: {
Expand All @@ -214,6 +224,8 @@ class NodeConnection {
manifest: AgentClientManifest;
connectionKeepAliveIntervalTime?: number;
connectionKeepAliveTimeoutTime?: number;
connectionInitialMaxStreamsBidi?: number;
connectionInitialMaxStreamsUni?: number;
quicSocket: QUICSocket;
logger?: Logger;
},
Expand Down Expand Up @@ -255,6 +267,8 @@ class NodeConnection {
ca: undefined,
key: tlsConfig.keyPrivatePem,
cert: tlsConfig.certChainPem,
initialMaxStreamsBidi: connectionInitialMaxStreamsBidi,
initialMaxStreamsUni: connectionInitialMaxStreamsUni,
},
crypto: nodesUtils.quicClientCrypto,
reasonToCode: nodesUtils.reasonToCode,
Expand Down
23 changes: 22 additions & 1 deletion src/nodes/NodeConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@ class NodeConnectionManager {
*/
public readonly connectionHolePunchIntervalTime: number;

/**
* Total number of active bidirectional streams that can be created
*/
public readonly connectionInitialMaxStreamsBidi: number;

/**
* Total number of active unidirectional streams that can be created
*/
public readonly connectionInitialMaxStreamsUni: number;

/**
* Max parse buffer size before RPC parser throws an parse error.
*/
Expand Down Expand Up @@ -370,9 +380,12 @@ class NodeConnectionManager {
.nodesConnectionKeepAliveIntervalTime,
connectionHolePunchIntervalTime = config.defaultsSystem
.nodesConnectionHolePunchIntervalTime,
connectionInitialMaxStreamsBidi = config.defaultsSystem
.nodesConnectionInitialMaxStreamsBidi,
connectionInitialMaxStreamsUni = config.defaultsSystem
.nodesConnectionInitialMaxStreamsUni,
rpcParserBufferSize = config.defaultsSystem.rpcParserBufferSize,
rpcCallTimeoutTime = config.defaultsSystem.rpcCallTimeoutTime,

logger,
}: {
keyRing: KeyRing;
Expand All @@ -386,6 +399,8 @@ class NodeConnectionManager {
connectionKeepAliveTimeoutTime?: number;
connectionKeepAliveIntervalTime?: number;
connectionHolePunchIntervalTime?: number;
connectionInitialMaxStreamsBidi?: number;
connectionInitialMaxStreamsUni?: number;
rpcParserBufferSize?: number;
rpcCallTimeoutTime?: number;
logger?: Logger;
Expand All @@ -402,6 +417,8 @@ class NodeConnectionManager {
this.connectionKeepAliveTimeoutTime = connectionKeepAliveTimeoutTime;
this.connectionKeepAliveIntervalTime = connectionKeepAliveIntervalTime;
this.connectionHolePunchIntervalTime = connectionHolePunchIntervalTime;
this.connectionInitialMaxStreamsBidi = connectionInitialMaxStreamsBidi;
this.connectionInitialMaxStreamsUni = connectionInitialMaxStreamsUni;
this.rpcParserBufferSize = rpcParserBufferSize;
this.rpcCallTimeoutTime = rpcCallTimeoutTime;

Expand All @@ -422,6 +439,8 @@ class NodeConnectionManager {
cert: tlsConfig.certChainPem,
verifyPeer: true,
verifyCallback: nodesUtils.verifyClientCertificateChain,
initialMaxStreamsBidi: 1000,
initialMaxStreamsUni: 0,
},
socket: quicSocket,
reasonToCode: nodesUtils.reasonToCode,
Expand Down Expand Up @@ -736,6 +755,8 @@ class NodeConnectionManager {
tlsConfig: this.tlsConfig,
connectionKeepAliveIntervalTime: this.connectionKeepAliveIntervalTime,
connectionKeepAliveTimeoutTime: this.connectionKeepAliveTimeoutTime,
connectionInitialMaxStreamsBidi: this.connectionInitialMaxStreamsBidi,
connectionInitialMaxStreamsUni: this.connectionInitialMaxStreamsUni,
quicSocket: this.quicSocket,
logger: this.logger.getChild(
`${NodeConnection.name}Forward [${host}:${port}]`,
Expand Down
Loading