ipfs dag get
behavior for nodes that were not added explicitly using dag put
#6307
Labels
kind/support
A question or request for support
Version information:
Also reproduced on version 0.4.19 and on linux machines.
Type:
bug
Description:
I encountered a behavior that I didn't expect with the combination of
ipfs block put
andipfs dag get
.In short: I create a DAG node on IPFS node
N1
. A second IPFS nodeN2
can see and retrievethe block, but it cannot retrieve the DAG node. From the spec I expect that
N2
should be able to retrieve the DAG node even though it has not been explicitly stored.How to reproduce
Put a DAG node on IPFS node
N1
Consider this simple file:
We add it using
ipfs dag put
:We can then get it back with
ipfs dag get
:The CID
zdpuAxm8CKxE6NDM52feyqpfzzY8mX6pkbS3YujhvbU6Yf9xt
corresponds to the multihashQmagLRWbVtjZ4tpD3DWJYCWVNGGUUgzMd6tXPpjwgcow44
. We can see this by using:Try to retrieve the data from a different IPFS node
N2
Suppose another node
N2
has the same block.If the block above is not available anymore on the network, you can do:
Now, on
N2
, I write:What I would expect:
N2
recognizes that the CIDzdpu...9xt
corresponds to blockQmag...cow44
.Qmag...cow44
is readily available.What happens: The node hangs - not sure from the logs what's going on, but it is doing something related to getting
zdpuAxm8CKxE6NDM52feyqpfzzY8mX6pkbS3YujhvbU6Yf9xt
from the network, while the block is already available.Broader context
This behavior prevents having a valid workaround for the issues discussed in:
ipfs dag put
has known problems in mangling the data because of JSON transport (int
s get transferred tofloat
, etc.) so I need to useipfs block put
to store my DAG nodes to make sure that the data is not mangled. However when I do so, IPFS doesn't seem to be able to retrieve the DAG nodes via the CID, even though the blocks are properly stored. The example above is the simplest minimum case that reproduces the issue.The text was updated successfully, but these errors were encountered: