Skip to content

Commit

Permalink
[State Sync] Update the snapshot receiver to be thread spawnable.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLind authored and aptos-bot committed Mar 18, 2022
1 parent cef9b1f commit 4d446de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions storage/jellyfish-merkle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ pub trait TreeReader<V> {
fn get_rightmost_leaf(&self) -> Result<Option<(NodeKey, LeafNode<V>)>>;
}

pub trait TreeWriter<V> {
pub trait TreeWriter<V>: Send + Sync {
/// Writes a node batch into storage.
fn write_node_batch(&self, node_batch: &NodeBatch<V>) -> Result<()>;
}

/// `Value` defines the types of data that can be stored in a Jellyfish Merkle tree.
pub trait Value: Clone + CryptoHash + Serialize + DeserializeOwned {}
pub trait Value: Clone + CryptoHash + Serialize + DeserializeOwned + Send + Sync {}

/// `TestValue` defines the types of data that can be stored in a Jellyfish Merkle tree and used in
/// tests.
Expand Down
2 changes: 1 addition & 1 deletion storage/storage-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl TreeState {
}
}

pub trait StateSnapshotReceiver<V> {
pub trait StateSnapshotReceiver<V>: Send {
fn add_chunk(
&mut self,
chunk: Vec<(HashValue, V)>,
Expand Down

0 comments on commit 4d446de

Please sign in to comment.