-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add GET /register/:L2_ID #37
Comments
|
yep! l2s will not be listening for any inbound connections from l1s. only l1s listening for inbound connections from l2s
not to steal any of diego's thunder, but they do indeed 🙂
ya. painful
that said, initial connection setup time between l1<->l2 shouldnt matter too much, as that connection remains open once established. this cost only has to be paid once for every l1<->l2 pairing
if both the l1 and l2 talk http2, which was my original thought, http2's multiplexing takes care of this and l1s can just issue plain jane http requests for every piece of content they want and l2s can respond with plain jane http responses. no SSE, or HTTP POST requests from l2 to l1, required on the l1 side, nginx and node both support http2 out of the box the golang http2 story looks 'solved', too. eg https://pkg.go.dev/golang.org/x/net/http2 |
I think @juliangruber and @DiegoRBaquero had a discussion where they arrived at the conclusion that http2 does NOT work well with nginx or something ? |
ah. i wasnt in that convo if that's the case, im unaware of how/where http2 fails us here |
While both nginx and nodejs support http/2, nginx doesn't support upstream server push. This means that l1 can't send a It was just discussed in Slack whether we could start off by l2 creating a tcp connection to l1, and both parties then sending http messages over it. We're postponing this idea for now, while it could give great performance it will require some experimentation with the http language implementations, as this is not a common use case. The current plan is SSE-ish for CID requests and POST for CAR responses. This will create 2 connections, one for CID requests and the other for POST responses. We're going to experiment afterwards with upgrading to HTTP/2, which will hopefully bring down the connection count to 1. As an alternative for SSE-ish, we discussed websockets, because its framing layer is more sturdy than NLJSON. It should be a great alternative if SSE-ish doesn't work, however brings its own complexity so IMO isn't the obvious way to go. |
I've changed this method from |
* add basic GET /register/:l2id * FIXME * flow works if we disable forking * clean up * lint * fix demo * block cid * fix write after end * add cluster logging * enable cluster again * shorten heartbeat interval for testing * add Cache-Control header * remove node:cluster * fix type error * run multiple node processes * refactor * allow testing cid again * Revert "run multiple node processes" This reverts commit bffdce2. * Revert "remove node:cluster" This reverts commit e9dfbbd. * clean up * only one fork for now * websocket implementation with flaws * fix consistent hashing * fix timeout error handling * enable cluster again * reduce to one worker again * Revert "websocket implementation with flaws" This reverts commit 034e0f8. * heartbeat is just an empty line * clean up * pass on requestId from nginx * remove node:cluster again * clean up * send heartbeat immediately * fix inconsistent naming * refactor using async functions * clean up * add CAR validation * fix debug * disable l2 integration in main network * refactor * refactor * enable l2 fire and forget * add car extraction * disable l2 fallback on file path req * use asyncHandler * remove cluster again (merge error)
L2 nodes will call this route to establish a long-lived connection, so that L1 can on demand make requests to it.
Protocol see https://www.notion.so/pl-strflt/Elaborate-L1-L2-MVP-flow-and-mechanics-793d381d04974a6b903078bf10e72b2a.
For filecoin-saturn/L2-node#48.
The text was updated successfully, but these errors were encountered: