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

booster-bitswap block filter #731

Closed
Tracked by #709
dirkmc opened this issue Aug 25, 2022 · 4 comments
Closed
Tracked by #709

booster-bitswap block filter #731

dirkmc opened this issue Aug 25, 2022 · 4 comments
Labels
area/retrieval Area: Retrieval

Comments

@dirkmc
Copy link
Contributor

dirkmc commented Aug 25, 2022

Add a mechanism by which booster-bitswap can deny requests for a cid.

For example

  • bitswap client requests cid abcd (either want-have or want-block)
  • booster-bitswap calls filter with abcd as a parameter and receives true / false response
  • if true bitswap server returns the block
  • if false bitswap server returns DONT_HAVE

Examples of filter mechanisms:

  • a script that takes the cid as a parameter and returns an exit code of 0 or 1
  • an http endpoint that takes the cid as a parameter and returns 200 or 404

We should experiment with these filter mechanisms to see what is most intuitive and performant.

The filter should use the WithPeerBlockRequestFilter hook to approve / deny requests for a block.

@LaurenSpiegel
Copy link
Collaborator

  1. bitscreen hooks into the lotus config so should still be picked up by boost -- https://github.com/Murmuration-Labs/bitscreen-cli/blob/main/bitscreen_cli/commands/setup.py#L89

BUT...is the place/way it filters compatible with how we would call a filter function for bitswap?

  1. It looks like bitscreen is doing a linear lookup for each CID request if I am reading correctly and the file read process is what is usually used -- https://github.com/Murmuration-Labs/bitscreen/blob/master/bitscreen.go#L132

or just lookup in set if using the server (preferable since has updates) -- https://github.com/Murmuration-Labs/bitscreen-updater/blob/master/bitscreen_updater/__main__.py#L75

We should test out hitting it and see how performance is impacted.


If bitscreen is not a good fit, we can

  1. ask the bitscreen team to modify
  2. simply set up a client that can hit a server holding the badbits (https://badbits.dwebops.pub/) or other deny list and returns whether to filter or not.

As a next step it might make sense to set up a joint call to have the bitscreen team walk us through how it is supposed to work and any limitations/issues we should be aware of.

cc @brendalee

@willscott
Copy link
Collaborator

this is also relevant for booster-http #946

Should each edge retrieval process call filters / enforce policy, or should it happen at the centralized call to the piece metastore pieceMeta.BlockstoreGet(ctx, blockCid)?

@jacobheun
Copy link
Contributor

This issue should be resolved via #825 correct @dirkmc ?

@jacobheun jacobheun added the area/retrieval Area: Retrieval label Nov 25, 2022
@dirkmc
Copy link
Contributor Author

dirkmc commented Nov 28, 2022

Yes, closing

@dirkmc dirkmc closed this as completed Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/retrieval Area: Retrieval
Projects
Status: Done
Development

No branches or pull requests

4 participants