From 54c0ae17f4ecf2ada41815d96c1acecb69e22244 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Wed, 22 Jul 2020 15:26:57 -0400 Subject: [PATCH 1/3] Implement buffered blocktore GetSize() --- lib/bufbstore/buf_bstore.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/bufbstore/buf_bstore.go b/lib/bufbstore/buf_bstore.go index 4b430828b..edc08770c 100644 --- a/lib/bufbstore/buf_bstore.go +++ b/lib/bufbstore/buf_bstore.go @@ -104,7 +104,12 @@ func (bs *BufferedBS) Get(c cid.Cid) (block.Block, error) { } func (bs *BufferedBS) GetSize(c cid.Cid) (int, error) { - panic("nyi") + s, err := bs.read.GetSize(c) + if err == bstore.ErrNotFound || s == 0 { + return bs.write.GetSize(c) + } + + return 0, err } func (bs *BufferedBS) Put(blk block.Block) error { From 2c895e8df2f812bce1210d1d67748b8ff2a09ecf Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Wed, 22 Jul 2020 23:34:26 -0400 Subject: [PATCH 2/3] update devnet in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a15276ee2..d8550748d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ All work is tracked via issues. An attempt at keeping an up-to-date view on rema The main branches under development at the moment are: * [`master`](https://github.com/filecoin-project/lotus): current testnet. * [`next`](https://github.com/filecoin-project/lotus/tree/next): working branch with chain-breaking changes. -* [`interopnet`](https://github.com/filecoin-project/lotus/tree/interopnet): devnet running one of `next` commits. +* [`ntwk-calibration`](https://github.com/filecoin-project/lotus/tree/ntwk-calibration): devnet running one of `next` commits. ## License From df801470caffed263829508b46378df0421ec905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 23 Jul 2020 10:23:44 +0200 Subject: [PATCH 3/3] Return size in bufbs.GetSize --- lib/bufbstore/buf_bstore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bufbstore/buf_bstore.go b/lib/bufbstore/buf_bstore.go index edc08770c..4000df7d6 100644 --- a/lib/bufbstore/buf_bstore.go +++ b/lib/bufbstore/buf_bstore.go @@ -109,7 +109,7 @@ func (bs *BufferedBS) GetSize(c cid.Cid) (int, error) { return bs.write.GetSize(c) } - return 0, err + return s, err } func (bs *BufferedBS) Put(blk block.Block) error {