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

Enable TCP NODELAY on Deno #665

Merged
merged 3 commits into from
Jun 7, 2023
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
4 changes: 4 additions & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- A `validated` event is now properly generated when watching a transaction using `transaction_unstable_submitAndWatch`. ([#676](https://github.com/smol-dot/smoldot/pull/676))
- Fix `author_submitAndWatchExtrinsic` erroneously generating `transaction_unstable_watchEvent` notifications, and `transaction_unstable_submitAndWatch` erroneously generating `author_extrinsicUpdate` notifications. ([#677](https://github.com/smol-dot/smoldot/pull/677))

### Changed

- TCP NODELAY is now enabled on Deno. The minimum required Deno version is now v1.29.0, which was released on 2022-12-14. ([#665](https://github.com/smol-dot/smoldot/pull/665))

## 1.0.8 - 2023-06-05

### Changed
Expand Down
19 changes: 7 additions & 12 deletions wasm-node/javascript/src/no-auto-bytecode-deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,10 @@ function connect(config: ConnectionConfig): Connection {
};

socket.inner = socket.inner.then((established) => {
// TODO: at the time of writing of this comment, `setNoDelay` is still unstable
//established.setNoDelay();

if (socket.destroyed)
return established;

established?.setNoDelay();
config.onOpen({ type: 'single-stream', handshake: 'multistream-select-noise-yamux', initialWritableBytes: 1024 * 1024, writeClosable: true });

// Spawns an asynchronous task that continuously reads from the socket.
Expand Down Expand Up @@ -396,16 +395,12 @@ declare namespace Deno {

export interface TcpConn extends Conn {
/**
* **UNSTABLE**: new API, see https://github.com/denoland/deno/issues/13617.
*
* Enable/disable the use of Nagle's algorithm. Defaults to true.
*/
setNoDelay(nodelay?: boolean): void;
/**
* **UNSTABLE**: new API, see https://github.com/denoland/deno/issues/13617.
* Enable/disable the use of Nagle's algorithm.
*
* Enable/disable keep-alive functionality.
* @param [noDelay=true]
*/
setKeepAlive(keepalive?: boolean): void;
setNoDelay(noDelay?: boolean): void;
/** Enable/disable keep-alive functionality. */
setKeepAlive(keepAlive?: boolean): void;
}
}