From a1a3b0bc0bd176f96327706c7270a789ab8afffd Mon Sep 17 00:00:00 2001 From: Bulat-Ziganshin Date: Sun, 3 Jul 2022 01:24:34 +0300 Subject: [PATCH] Updated Blockstores (markdown) --- Blockstores.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Blockstores.md b/Blockstores.md index 99a5ff1..14d408e 100644 --- a/Blockstores.md +++ b/Blockstores.md @@ -30,4 +30,10 @@ method listBlocks*(self: BlockStore, onBlock: OnBlock): Future[?!void] proc contains*(self: BlockStore, blk: Cid): Future[bool] ## Check if the block exists in the blockstore. ## Return false if error encountered -``` \ No newline at end of file +``` + +Notes: +- all real errors should be signaled via Return +- getBlock may fail to find a block with given id - return Block.none in this case in order to distinguish that from "hard failures", such as ruined DB. F.e. in BlockExc we can delete block in one task before another task get a chance to read it - it's not a failure at all +- putBlock can create new block or overwrite existing one - we don't care, thus `void` +- delBlock: if it can't delete a block - it's an error; if block already doesn't exist - we don't care (it may be deleted by other task) \ No newline at end of file