node icon indicating copy to clipboard operation
node copied to clipboard

quic: start adding in the internal quic js api

Open jasnell opened this issue 1 year ago • 10 comments

While the external API for QUIC is expected to be the WebTransport API primarily, this provides the internal API for QUIC that aligns with the native C++ QUIC components. This is the first of several PRs that will fill out this part of the implementation. The goal of doing this incrementally is to make things easier to review by doing it in smaller chunks

jasnell avatar Jun 02 '24 03:06 jasnell

Really interesting @jasnell .

Just a reminder we have continued to apply fixes to your original attempt many of which probably still apply today (latest branch: https://github.com/HalleyAssist/node/commits/test_quic16/ - not everything in this branch is relevant). Some fixes could probably done better with more drastic changes, however they all represent observed leaks, infinite loops or crashes observed in our staging and pilot environments.

Including yesterday a fix for blocking streams creating an infinite loop in SendPendingData (which can be tested for with rx packet loss simulation). When you do get a JS api I'll try and contribute some of these directly.

splitice avatar Jun 07 '24 03:06 splitice

Updated the implementation fairly significantly here.

  1. Endpoint,Session, and Stream are no longer EventTarget subclasses. Instead, the constructor for Endpoint takes an object will callbacks that will be called. This preserves the idea that these are low-level APIs meant to be wrapped by other APIs to expose to users. The fact that these aren't EventTargets and Event objects aren't used should yield a fairly significant performance boost in the underlying bits.
  2. The constructors can be called directly. Since these are meant to be internal APIs there's not much harm in exposing those
  3. Uses more primordials consistently. I know there's some effort to remove primordials but as an internal API it makes sense here.
  4. Removing the use of ReadableStream/WritableStream at this level. These will be replaced with lower-level APIs and callbacks in the next step.

jasnell avatar Jul 06 '24 21:07 jasnell

CI: https://ci.nodejs.org/job/node-test-pull-request/60124/

nodejs-github-bot avatar Jul 06 '24 21:07 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/60127/

nodejs-github-bot avatar Jul 07 '24 00:07 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/60130/

nodejs-github-bot avatar Jul 07 '24 00:07 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/60131/ 💚

nodejs-github-bot avatar Jul 07 '24 03:07 nodejs-github-bot

This is generally ready to go except for the "Coverage" github CI tests. Working on increasing the test coverage now to the minimum that'll pass.

jasnell avatar Jul 07 '24 22:07 jasnell

CI: https://ci.nodejs.org/job/node-test-pull-request/62829/

nodejs-github-bot avatar Sep 28 '24 16:09 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/62830/

nodejs-github-bot avatar Sep 28 '24 17:09 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/62831/ 💛

nodejs-github-bot avatar Sep 28 '24 17:09 nodejs-github-bot

Landed in 103b8439cae2...858bce569808

jasnell avatar Sep 29 '24 18:09 jasnell

This landed with failing Coverage CI, and now it fails for all PRs against main

targos avatar Sep 30 '24 13:09 targos