diff --git a/zebra-state/src/on_disk.rs b/zebra-state/src/on_disk.rs index e1ac5a35d..84bb58468 100644 --- a/zebra-state/src/on_disk.rs +++ b/zebra-state/src/on_disk.rs @@ -133,7 +133,12 @@ impl Service for SledState { Request::AddBlock { block } => { let mut storage = self.clone(); - async move { storage.insert(block).map(|hash| Response::Added { hash }) }.boxed() + // Make sure writes to the state are serialised, by performing + // them in the state's call. + // (See the state design RFC #0005 for details.) + let result = storage.insert(block).map(|hash| Response::Added { hash }); + + async { result }.boxed() } Request::GetBlock { hash } => { let storage = self.clone();