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

Add complete IPFS path validation #1885

Closed
Arjentix opened this issue Feb 8, 2022 · 3 comments
Closed

Add complete IPFS path validation #1885

Arjentix opened this issue Feb 8, 2022 · 3 comments
Assignees
Labels
Enhancement New feature or request good first issue Good for newcomers iroha2-dev The re-implementation of a BFT hyperledger in RUST

Comments

@Arjentix
Copy link
Contributor

Arjentix commented Feb 8, 2022

Complete validation requires checking if path is composed only from valid hashes

ipfs crate source code can be helpfull

Alternative implementations

#1606

@Arjentix Arjentix added Enhancement New feature or request iroha2-dev The re-implementation of a BFT hyperledger in RUST labels Feb 8, 2022
@appetrosyan appetrosyan added the good first issue Good for newcomers label Apr 19, 2022
@ilchu ilchu self-assigned this May 11, 2022
@ilchu
Copy link
Contributor

ilchu commented May 11, 2022

After some research I am doubtful if this is actually feasible in the scope of data_model crate. There are two ways which I see could be possible for file fetching after decoding the CID hash, namely either bootstrapping a whole IPFS node and running some Kademlia FIND_VALUE queries or trying to fetch it through an HTTP gateway.

The first one has the overhead of bringing in at least the ipfs and tokio or maybe warp, as the
ipfs crate example for fetching shows, which I believe is out of scope of our data model.

The second one would only require something like reqwest, but is still likely to fail miserably, as IPFS currently doesn't seem to have a mechanism for validating file absence (because even if the closest discovered peer lacks the content, we still have to go deeper down the chain hoping some next one might have it), and basically the only way to signal it is request timeout. An example I've found is from an Infura user of the gateway, and there doesn't seem to have been any progress on that from their part from what I can gather. When done manually with an invalid path (e.g. https://ipfs.io/ipfs/Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoii) via httpie, it just expires in a minute with HTTP/1.1 504 Gateway Time-out as expected.

What would be your thoughts on this?

@ilchu ilchu removed their assignment May 12, 2022
@appetrosyan
Copy link
Contributor

I think we should re-visit this in the Blockchain explorer context. I'll add the relevant issue to the board, and re-assign work.

@appetrosyan
Copy link
Contributor

Closed in favour of soramitsu/iroha2-block-explorer-backend#20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request good first issue Good for newcomers iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

No branches or pull requests

3 participants