StorageManager is a higher-level abstract of ShardManager which provides multi-thread safety to storage file read/write and a consistent view of most-recent-finalized L1 block.
| 67 | // StorageManager is a higher-level abstract of ShardManager which provides multi-thread safety to storage file read/write |
| 68 | // and a consistent view of most-recent-finalized L1 block. |
| 69 | type StorageManager struct { |
| 70 | DownloadThreadNum int |
| 71 | shardManager *ShardManager |
| 72 | localL1 int64 // local view of most-recent-finalized L1 block |
| 73 | mu sync.Mutex // protect kvEntryCount, shardManager and blobMeta read/write state |
| 74 | kvEntryCount uint64 // kvEntryCount in the most-recent-finalized L1 block |
| 75 | l1Source Il1Source |
| 76 | blobMetas map[uint64][32]byte |
| 77 | lg log.Logger |
| 78 | } |
| 79 | |
| 80 | func NewStorageManager(sm *ShardManager, l1Source Il1Source, lg log.Logger) *StorageManager { |
| 81 | return &StorageManager{ |
nothing calls this directly
no outgoing calls
no test coverage detected