Skip to content

Commit 290fd55

Browse files
committed
Revert "fix saving shard hdr to storage on meta epoch start"
This reverts commit 70692d5.
1 parent 70692d5 commit 290fd55

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

epochStart/bootstrap/metaStorageHandler.go

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ func (msh *metaStorageHandler) saveEpochStartMetaHdrs(components *ComponentsNeed
284284
for _, hdr := range components.Headers {
285285
isForCurrentShard := hdr.GetShardID() == msh.shardCoordinator.SelfId()
286286
if !isForCurrentShard {
287-
_, err := msh.saveShardHdrToStorageWithoutEpochStartHandling(hdr)
287+
_, err := msh.saveShardHdrToStorage(hdr)
288288
if err != nil {
289289
return err
290290
}
@@ -301,43 +301,6 @@ func (msh *metaStorageHandler) saveEpochStartMetaHdrs(components *ComponentsNeed
301301
return nil
302302
}
303303

304-
func (msh *metaStorageHandler) saveShardHdrToStorageWithoutEpochStartHandling(hdr data.HeaderHandler) ([]byte, error) {
305-
headerBytes, err := msh.marshalizer.Marshal(hdr)
306-
if err != nil {
307-
return nil, err
308-
}
309-
310-
headerHash := msh.hasher.Compute(string(headerBytes))
311-
312-
shardHdrStorage, err := msh.storageService.GetStorer(dataRetriever.BlockHeaderUnit)
313-
if err != nil {
314-
return nil, err
315-
}
316-
317-
err = shardHdrStorage.Put(headerHash, headerBytes)
318-
if err != nil {
319-
return nil, err
320-
}
321-
322-
nonceToByteSlice := msh.uint64Converter.ToByteSlice(hdr.GetNonce())
323-
shardHdrNonceStorage, err := msh.storageService.GetStorer(dataRetriever.GetHdrNonceHashDataUnit(hdr.GetShardID()))
324-
if err != nil {
325-
return nil, err
326-
}
327-
328-
err = shardHdrNonceStorage.Put(nonceToByteSlice, headerHash)
329-
if err != nil {
330-
return nil, err
331-
}
332-
333-
err = msh.saveProofToStorage(hdr.GetShardID(), headerHash, hdr)
334-
if err != nil {
335-
return nil, err
336-
}
337-
338-
return headerHash, nil
339-
}
340-
341304
func (msh *metaStorageHandler) saveLastCrossNotarizedHeaders(
342305
meta data.MetaHeaderHandler,
343306
mapHeaders map[string]data.HeaderHandler,

0 commit comments

Comments
 (0)