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
Iterates over in-memory Blockstore and writes NMT Merkle
proofs stored in it
NOTES:
CAR provides a utility to serialize any DAG into the file
and there is a way to serialize EDS into DAG(share/ipld.ImportShares). This approach is the simplest and traverses
shares and Merkle Proofs in a depth-first manner packing them in a CAR file. However, this is incompatible with the
requirement of being able to truncate the CAR file reading out only the first quadrant out of it without NMT proofs,
so serialization must be different from the utility to support that.
Alternatively to WriteEDS, an EDSReader could be introduced to make EDS-to-stream handling more idiomatic
and efficient in some cases, with the cost of more complex implementation.
// WriteEDS writes the whole EDS into the given io.Writer as CARv1 file.// All its shares and recomputed NMT proofs.funcWriteEDS(context.Context, *rsmt2d.ExtendedDataSquare, io.Writer) error
The text was updated successfully, but these errors were encountered:
Context
As per #1099, we want to store EDSes as a whole. For this, the CAR format is chosen.
Implementation Details
To write EDS into a stream/file,
WriteEDS
is introduced. Internally it:ipld.ImportShares
Blockservice
with offlineexchange and in-memory
Blockstore
NodeVisitor
, which saves to theBlockstore
only NMT Merkle proofs(no shares) NOTE:len(node.Links()) == 2
CARv1Header
Roots
field withEDS.RowRoots/EDS.ColRoots
roots converted into CIDsEDS.GetCell
proofs stored in it
NOTES:
and there is a way to serialize EDS into DAG(
share/ipld.ImportShares
). This approach is the simplest and traversesshares and Merkle Proofs in a depth-first manner packing them in a CAR file. However, this is incompatible with the
requirement of being able to truncate the CAR file reading out only the first quadrant out of it without NMT proofs,
so serialization must be different from the utility to support that.
WriteEDS
, anEDSReader
could be introduced to make EDS-to-stream handling more idiomaticand efficient in some cases, with the cost of more complex implementation.
The text was updated successfully, but these errors were encountered: