From 490121c39288216d28b464da09ec476a82676255 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 16 Nov 2022 10:46:54 -0800 Subject: [PATCH 1/2] fix: patch funty for now Upstream broke the world by yanking a version. --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 864220577..fa8547e3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,3 +17,8 @@ overflow-checks = true lto = true opt-level = "z" #strip = true + +[patch.crates-io] +# temporary solution to funty@1.2.0 being yanked, we should propose bitvec upgrade to upstream filecoin crates +# tracking issue: https://github.com/bitvecto-rs/funty/issues/7 +funty = { git = "https://github.com/bitvecto-rs/funty/", rev = "7ef0d890fbcd8b3def1635ac1a877fc298488446" } From fcfac84e8663b1e95c456c7660ed1ffa31822594 Mon Sep 17 00:00:00 2001 From: raulk Date: Wed, 16 Nov 2022 18:52:22 +0000 Subject: [PATCH 2/2] fix: BufferedBlockstore#flush should not reset the write buffer. (#1096) Resetting the buffer was never advertised as a behaviour of this method. This makes it possible to call flush multiple times to selectively flush roots during its lifetime. Selective flushes are used to flush the event AMTs as they are being produced. --- fvm/src/blockstore/buffered.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fvm/src/blockstore/buffered.rs b/fvm/src/blockstore/buffered.rs index 422b8f072..f1f5e4253 100644 --- a/fvm/src/blockstore/buffered.rs +++ b/fvm/src/blockstore/buffered.rs @@ -42,14 +42,13 @@ where { /// Flushes the buffered cache based on the root node. /// This will recursively traverse the cache and write all data connected by links to this - /// root Cid. + /// root Cid. Calling flush will not reset the write buffer. fn flush(&self, root: &Cid) -> Result<()> { let mut buffer = Vec::new(); - let mut s = self.write.borrow_mut(); + let s = self.write.borrow(); copy_rec(&s, *root, &mut buffer)?; self.base.put_many_keyed(buffer)?; - *s = Default::default(); Ok(()) } @@ -290,7 +289,6 @@ mod tests { buf_store.flush(&cid).unwrap(); assert_eq!(buf_store.get_cbor::(&cid).unwrap(), Some(8)); assert_eq!(mem.get_cbor::(&cid).unwrap(), Some(8)); - assert!(buf_store.write.borrow().get(&cid).is_none()); } #[test] @@ -361,6 +359,5 @@ mod tests { assert_eq!(buf_store.get(&unsealed_comm_cid).unwrap(), None); assert_eq!(buf_store.get(&sealed_comm_cid).unwrap(), None); assert_eq!(mem.get_cbor::(&unconnected).unwrap(), None); - assert_eq!(buf_store.get_cbor::(&unconnected).unwrap(), None); } }