Skip to content

Commit

Permalink
fix: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
fearlessfe authored and GrapeBaBa committed Sep 26, 2024
1 parent 0fa168f commit eea2d93
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions portalnetwork/history/history_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,50 +255,6 @@ func (h *HistoryNetwork) GetReceipts(blockHash []byte) ([]*types.Receipt, error)
return nil, storage.ErrContentNotFound
}

// func (h *HistoryNetwork) GetEpochAccumulator(epochHash []byte) (*EpochAccumulator, error) {
// contentKey := newContentKey(EpochAccumulatorType, epochHash).encode()
// contentId := h.portalProtocol.ToContentId(contentKey)

// res, err := h.portalProtocol.Get(contentKey, contentId)
// // other error
// if err != nil && !errors.Is(err, storage.ErrContentNotFound) {
// return nil, err
// }
// // no error
// if err == nil {
// epochAccu, err := decodeEpochAccumulator(res)
// return epochAccu, err
// }
// for retries := 0; retries < requestRetries; retries++ {
// content, _, err := h.portalProtocol.ContentLookup(contentKey, contentId)
// if err != nil {
// h.log.Error("getEpochAccumulator failed", "contentKey", hexutil.Encode(contentKey), "err", err)
// continue
// }
// epochAccu, err := decodeEpochAccumulator(content)
// if err != nil {
// h.log.Error("decodeEpochAccumulator failed", "content", hexutil.Encode(content), "err", err)
// continue
// }
// hash, err := epochAccu.HashTreeRoot()
// if err != nil {
// h.log.Error("hashTreeRoot failed", "err", err)
// continue
// }
// mixHash := MixInLength(hash, epochSize)
// if !bytes.Equal(mixHash, epochHash) {
// h.log.Error("epochHash is not equal", "mixHash", hexutil.Encode(mixHash), "epochHash", hexutil.Encode(epochHash))
// continue
// }
// err = h.portalProtocol.Put(contentKey, contentId, content)
// if err != nil {
// h.log.Error("failed to store content in getReceipts", "contentKey", hexutil.Encode(contentKey), "content", hexutil.Encode(content))
// }
// return epochAccu, nil
// }
// return nil, storage.ErrContentNotFound
// }

func (h *HistoryNetwork) verifyHeader(header *types.Header, proof BlockHeaderProof) (bool, error) {
return h.masterAccumulator.VerifyHeader(*header, proof)
}
Expand Down

0 comments on commit eea2d93

Please sign in to comment.