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
We can resolve some TODO's by taking advantage of the blob serialization algorithm created in #92 by @nisdas. When creating a new collation object and having access to the collation's byte serialized body, we can deserialize that body into a slice of transactions that we can pass into the NewCollation function.
An example of this is in shard.go, but there are other similar todo's.
// CollationByHash fetches full collation.func (s*Shard) CollationByHash(headerHash*common.Hash) (*Collation, error) {
header, err:=s.HeaderByHash(headerHash)
iferr!=nil {
returnnil, fmt.Errorf("cannot fetch header by hash: %v", err)
}
body, err:=s.BodyByChunkRoot(header.ChunkRoot())
iferr!=nil {
returnnil, fmt.Errorf("cannot fetch body by chunk root: %v", err)
}
// TODO: deserializes the body into a txs slice instead of using// nil as the third arg to MakeCollation.col:=NewCollation(header, body, nil)
returncol, nil
}
Another one occurs when saving the collation's body:
// SaveBody adds the collation body to the shardDB and sets availability.func (s*Shard) SaveBody(body []byte) error {
// TODO: check if body is empty and throw error.// TODO: dependent on blob serialization.// right now we will just take the raw keccak256 of the body until #92 is merged.chunkRoot:=common.BytesToHash(body)
s.SetAvailability(&chunkRoot, true)
returns.shardDB.Put(chunkRoot, body)
}
The text was updated successfully, but these errors were encountered:
We can resolve some TODO's by taking advantage of the blob serialization algorithm created in #92 by @nisdas. When creating a new collation object and having access to the collation's byte serialized body, we can deserialize that body into a slice of transactions that we can pass into the
NewCollation
function.An example of this is in
shard.go
, but there are other similar todo's.Another one occurs when saving the collation's body:
The text was updated successfully, but these errors were encountered: