From 2f2e7be12ae4ae1f93123388c1fbe1c4362495e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 24 Jan 2020 21:15:02 +0100 Subject: [PATCH] sealing: docstrings for sanity-checks --- storage/sealing/checks.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/storage/sealing/checks.go b/storage/sealing/checks.go index 94ad95771..9baf2d993 100644 --- a/storage/sealing/checks.go +++ b/storage/sealing/checks.go @@ -22,6 +22,11 @@ type ErrExpiredDeals struct{ error } type ErrBadCommD struct{ error } type ErrExpiredTicket struct{ error } +// checkPieces validates that: +// - Each piece han a corresponding on chain deal +// - Piece commitments match with on chain deals +// - Piece sizes match +// - Deals aren't expired func checkPieces(ctx context.Context, si SectorInfo, api sealingApi) error { head, err := api.ChainHead(ctx) if err != nil { @@ -50,6 +55,8 @@ func checkPieces(ctx context.Context, si SectorInfo, api sealingApi) error { return nil } +// checkSeal checks that data commitment generated in the sealing process +// matches pieces, and that the seal ticket isn't expired func checkSeal(ctx context.Context, maddr address.Address, si SectorInfo, api sealingApi) (err error) { head, err := api.ChainHead(ctx) if err != nil {