Closed timwu20 closed 2 days ago
Reviewed about half of it and will continue reviewing it tomorrow
@P1sar I'm going to resolve our conversations so I can merge this PR. If you have any more questions/comments we can continue on the next PR or schedule a call.
Changes
blockchain.Backend
interface which embedsblockchain.HeaderBackend
andblockchain.HeaderMetadata
interfaces.blockchainDB
implementsblockchain.Backend
, and will be used as dependancy in later work inside the introduceddb
package.blockchainDB
is essentially the persistance layer for blocks. It will persist to the underlyingdatabase.Database
, and also provides caching mechanisms to improve performance.blockchainDB
has a number of subdependencies that are included in this PR.blockchainDB
Dependenciesapi.LeafSet
client/api
package based on location of analagous type in substrate. Will consider moving this withinclient/db
namespace once determined that no future work will need this.db.pinnedBlocksCache
blockchain.HeaderMetadataCache
CachedHeaderMetadata
types in a fixed size LRU cache.primitives/blockchain
package based on location of analagous type in substrate. Will consider moving this withinclient/db
namespace once determined that no future work will need this.Primitives
database.Database
database.Database
is the interface to commit transactions as well as retrieve values.database.Transaction
interface which defines a series of changes to the database that committed atomically.client/db
package.runtime
runtime
package which contains interfaces regardingNumber
,Hasher
,Header
,Block
,Extrinsic
,Justification
, andDigest
.runtime
calledgeneric
implement block theBlock
andHeader
types that conform to the same SCALE encoding as substrate.Tests
Issues