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
I think it is more sustainable to maintain a handful of dedicated implementations that individually do one job well (something like feather and something that would maintain state to support unordered dags are really different).
Unified middle layer
The way I have been writing my implementations is by jugling bytes unixfs.proto and dag-pb.proto by hand everywhere.
This is kinda meh looking because of all the little details that have to be checked.
I really think we need some efficient middle layer that takes in blocks.Block parse them, do sanity checks and return some representation that looks like internal unixfs (so one node per block, and full support for all schenanigans you would want to do but with error checking):
This would not includes helper functions for more advanced stuff like HAMT, chunking, ... we will most likely need thoses too but the goal here is to provide a thin wrapper around the protobuf that add the repetitive input validation.
Impls
List of implementations we need:
Efficient state-light streaming decoder with incremental verification. (I'll probably use feather after refactoring it to use the unified lower layer and adding the missing features)
The goal is to incremental verify ordered .car files from saturn on the cheap resource wise. (and other ordered blocks sources)
Capable of streaming the verification of an ordered stream of block (such as a car file red from io.Reader) incrementally (while streaming the result out).
Interface must implement io.Reader for reading from files without any background goroutine (efficiency).
Decoder with incremental verification and output stream with random walk BFS input.
Streaming data in order can have a high cost, however if we are cleaver we can use .WriteAt to write blocks in any order as long as we receive roots before leaves (or cache leaves but then incremental verification is not possible)
MFS rewrite.
Some write opperation helpers (concatenate, chunking, ...)
Dedicated unixfs implementations are often much more performant and efficient.
See for example two of mines:
ipfs addimplementation that exists)io.Readerfile with incremental verification and data streaming)I think it is more sustainable to maintain a handful of dedicated implementations that individually do one job well (something like feather and something that would maintain state to support unordered dags are really different).
Unified middle layer
The way I have been writing my implementations is by jugling bytes
unixfs.protoanddag-pb.protoby hand everywhere.This is kinda meh looking because of all the little details that have to be checked.
I really think we need some efficient middle layer that takes in
blocks.Blockparse them, do sanity checks and return some representation that looks like internal unixfs (so one node per block, and full support for all schenanigans you would want to do but with error checking):This would not includes helper functions for more advanced stuff like HAMT, chunking, ... we will most likely need thoses too but the goal here is to provide a thin wrapper around the protobuf that add the repetitive input validation.
Impls
List of implementations we need:
The goal is to incremental verify ordered
.carfiles from saturn on the cheap resource wise. (and other ordered blocks sources)io.Reader) incrementally (while streaming the result out).io.Readerfor reading from files without any background goroutine (efficiency)..WriteAtto write blocks in any order as long as we receive roots before leaves (or cache leaves but then incremental verification is not possible)