Reset This function must be called before calling any other funcs, it will setup a local L1 view for the node.
(newL1 int64)
| 195 | |
| 196 | // Reset This function must be called before calling any other funcs, it will setup a local L1 view for the node. |
| 197 | func (s *StorageManager) Reset(newL1 int64) error { |
| 198 | s.mu.Lock() |
| 199 | defer s.mu.Unlock() |
| 200 | |
| 201 | kvEntryCount, err := s.l1Source.GetStorageKvEntryCount(newL1) |
| 202 | if err != nil { |
| 203 | return err |
| 204 | } |
| 205 | s.kvEntryCount = kvEntryCount |
| 206 | s.localL1 = newL1 |
| 207 | |
| 208 | return nil |
| 209 | } |
| 210 | |
| 211 | // CommitBlobs This function will be called when p2p sync received blobs. It will commit the blobs |
| 212 | // that match local L1 view and return the unmatched ones. |