-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: add batch denylist check #166
Conversation
Send an array of CID strings to check if they are on the denylist. Reponse is the subset of the array that is on the denylist. ```http POST / Content-Type: application/json ["cid1","cid2"] ``` License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
packages/denylist/src/denylist.js
Outdated
* @param {import('./env').Env} env | ||
*/ | ||
export async function denylistPost (request, env) { | ||
if (!request.json) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK this is not undefined if content-type is not json...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, right, i was following the itty-route request type which defines .json as optional, but isn't want i want to test for here. Fixing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
- cap the max number of cids we'll accept in a single message. - We're seeing 20k spikes in our `bitswap-pending-entries` metrics per node, so I'm putting in a hard cap of 500 wanted cids per message that we'll process. The caller can ask again if they need more. This also means i can put a sensible cap on how many cids the denylist service should handle in a batch. - check batches of cids against our denylist api. - cache entries that are on the denylist; they are rarely removed. - use cache to avoid asking about items we already know, and as a fallback if denylist service cannot be reached. - add `bitswap-denied` counter metric to see how many CIDs we skip due to being on the denylist see: batch endpoint for denylist api – storacha/reads#166 see: set DENYLIST_URL in env - elastic-ipfs/bitswap-peer-deployment#99 License: MIT --------- Signed-off-by: Oli Evans <oli@protocol.ai>
Send an array of CID strings to check if they are on the denylist. Response is the subset of the array that is on the denylist.
This will be used by e-ipfs to check a batch of cids at once, see: elastic-ipfs/bitswap-peer#215
License: MIT