You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is very unfortunate when the original request was for a single block adds cost of unnecessary CAR serialization and serialization, and creates surface for amplification bugs which are then worked around with things like #288 (and was the real reason why we did amplification attack against elastic IPFS last week).
Proposed fix
L1 knows if a request was for a single block (inspecting Accept: application/vnd.ipld.raw or ?format=raw), and in such case should ask Lassie the same response type. There should be no CAR.
The text was updated successfully, but these errors were encountered:
lidel
changed the title
Fetching a single block from Lassie as a CAR is wasteful and error-prone
Stop wrapping single block requests in CARs and graph requests
Mar 20, 2023
AFAIK there's no way to explicitly request single blocks, like you can with the IPFS Gateway's "raw" endpoint. Rather, you can specify a "shallow" depth which gets translated into a MatchUnixFSPreloadSelector, which may or may not return a single block, depending on if the CID is a directory or not.
#288 (now running in prod) defaults requests to a shallow depth, before it was full depth. That's the minimal request the L1 can make with the current Lassie API. Lassie metrics show that download bandwidth has reduced by 4x for P90, and up to 32x!!! for P95 requests.
Problem
iiuc L1 always asks Lassie for a CAR:
L1-node/container/shim/src/fetchers/lassie.js
Line 78 in 9be5194
L1-node/container/shim/src/fetchers/lassie.js
Lines 135 to 136 in 9be5194
This is very unfortunate when the original request was for a single block adds cost of unnecessary CAR serialization and serialization, and creates surface for amplification bugs which are then worked around with things like #288 (and was the real reason why we did amplification attack against elastic IPFS last week).
Proposed fix
L1 knows if a request was for a single block (inspecting
Accept: application/vnd.ipld.raw
or?format=raw
), and in such case should ask Lassie the same response type. There should be no CAR.The text was updated successfully, but these errors were encountered: