Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RetrieveQuadrantTimeout = blockTime / numQuadrants * 2
RetrieveQuadrantTimeout defines how much time Retriever waits before starting to retrieve another quadrant.
NOTE: - The whole data square must be retrieved in less than block time. - We have 4 quadrants from two sources(rows, cols) which equals to 8 in total.
Functions ¶
This section is empty.
Types ¶
type Parameters ¶ added in v0.11.0
type Parameters struct { // GC performs DAG store garbage collection by reclaiming transient files of // shards that are currently available but inactive, or errored. // We don't use transient files right now, so GC is turned off by default. GCInterval time.Duration // RecentBlocksCacheSize is the size of the cache for recent blocks. RecentBlocksCacheSize int // BlockstoreCacheSize is the size of the cache for blockstore requested accessors. BlockstoreCacheSize int }
func DefaultParameters ¶ added in v0.11.0
func DefaultParameters() *Parameters
DefaultParameters returns the default configuration values for the EDS store parameters.
func (*Parameters) Validate ¶ added in v0.11.0
func (p *Parameters) Validate() error
type Retriever ¶
type Retriever struct {
// contains filtered or unexported fields
}
Retriever retrieves rsmt2d.ExtendedDataSquares from the IPLD network. Instead of requesting data 'share by share' it requests data by quadrants minimizing bandwidth usage in the happy cases.
---- ---- | 0 | 1 | ---- ---- | 2 | 3 | ---- ----
Retriever randomly picks one of the data square quadrants and tries to request them one by one until it is able to reconstruct the whole square.
func NewRetriever ¶
func NewRetriever(bServ blockservice.BlockService) *Retriever
NewRetriever creates a new instance of the Retriever over IPLD BlockService and rmst2d.Codec
func (*Retriever) Retrieve ¶
func (r *Retriever) Retrieve(ctx context.Context, dah *da.DataAvailabilityHeader) (*rsmt2d.ExtendedDataSquare, error)
Retrieve retrieves all the data committed to DataAvailabilityHeader.
If not available locally, it aims to request from the network only one quadrant (1/4) of the data square and reconstructs the other three quadrants (3/4). If the requested quadrant is not available within RetrieveQuadrantTimeout, it starts requesting another quadrant until either the data is reconstructed, context is canceled or ErrByzantine is generated.