feat: merk state sync chunking #176
Annotations
33 warnings
very complex type used. Consider factoring parts into `type` definitions:
grovedb/src/lib.rs#L939
warning: very complex type used. Consider factoring parts into `type` definitions
--> grovedb/src/lib.rs:939:10
|
939 | ) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
very complex type used. Consider factoring parts into `type` definitions:
grovedb/src/lib.rs#L869
warning: very complex type used. Consider factoring parts into `type` definitions
--> grovedb/src/lib.rs:869:10
|
869 | ) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
|
very complex type used. Consider factoring parts into `type` definitions:
grovedb/src/lib.rs#L843
warning: very complex type used. Consider factoring parts into `type` definitions
--> grovedb/src/lib.rs:843:10
|
843 | ) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
|
this function has too many arguments (9/7):
grovedb/src/operations/proof/generate.rs#L478
warning: this function has too many arguments (9/7)
--> grovedb/src/operations/proof/generate.rs:478:5
|
478 | / fn generate_and_store_merk_proof<'a, S, B>(
479 | | &self,
480 | | path: &SubtreePath<B>,
481 | | subtree: &'a Merk<S>,
... |
487 | | key: &[u8],
488 | | ) -> CostResult<(Option<u16>, Option<u16>), Error>
| |______________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
this function has too many arguments (8/7):
grovedb/src/operations/proof/generate.rs#L172
warning: this function has too many arguments (8/7)
--> grovedb/src/operations/proof/generate.rs:172:5
|
172 | / fn prove_subqueries(
173 | | &self,
174 | | proofs: &mut Vec<u8>,
175 | | path: Vec<&[u8]>,
... |
180 | | is_verbose: bool,
181 | | ) -> CostResult<(), Error> {
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
this function has too many arguments (12/7):
grovedb/src/element/query.rs#L535
warning: this function has too many arguments (12/7)
--> grovedb/src/element/query.rs:535:5
|
535 | / fn query_item(
536 | | storage: &RocksDbStorage,
537 | | item: &QueryItem,
538 | | results: &mut Vec<QueryResultElement>,
... |
547 | | add_element_function: fn(PathQueryPushArgs) -> CostResult<(), Error>,
548 | | ) -> CostResult<(), Error> {
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
this function has too many arguments (8/7):
grovedb/src/element/query.rs#L138
warning: this function has too many arguments (8/7)
--> grovedb/src/element/query.rs:138:5
|
138 | / pub fn get_query_apply_function(
139 | | storage: &RocksDbStorage,
140 | | path: &[&[u8]],
141 | | sized_query: &SizedQuery,
... |
146 | | add_element_function: fn(PathQueryPushArgs) -> CostResult<(), Error>,
147 | | ) -> CostResult<(QueryResultElements, u16), Error> {
| |______________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
|
function `read_proof_version` is never used:
grovedb/src/versioning.rs#L12
warning: function `read_proof_version` is never used
--> grovedb/src/versioning.rs:12:8
|
12 | pub fn read_proof_version(mut bytes: &[u8]) -> Result<u32, Error> {
| ^^^^^^^^^^^^^^^^^^
|
method `open_merk_for_replication` is never used:
grovedb/src/lib.rs#L320
warning: method `open_merk_for_replication` is never used
--> grovedb/src/lib.rs:320:8
|
244 | impl GroveDb {
| ------------ method in this implementation
...
320 | fn open_merk_for_replication<'db, 'b, B>(
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
unused `std::result::Result` that must be used:
merk/src/proofs/chunk/chunk_op.rs#L57
warning: unused `std::result::Result` that must be used
--> merk/src/proofs/chunk/chunk_op.rs:57:17
|
57 | dest.write_all(&[1_u8]);
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
57 | let _ = dest.write_all(&[1_u8]);
| +++++++
|
unused `std::result::Result` that must be used:
merk/src/proofs/chunk/chunk_op.rs#L48
warning: unused `std::result::Result` that must be used
--> merk/src/proofs/chunk/chunk_op.rs:48:17
|
48 | dest.write_all(&[0_u8]);
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
48 | let _ = dest.write_all(&[0_u8]);
| +++++++
|
unused `grovedb_costs::CostContext` that must be used:
merk/src/merk/restore.rs#L392
warning: unused `grovedb_costs::CostContext` that must be used
--> merk/src/merk/restore.rs:392:13
|
392 | / self.merk
393 | | .load_base_root(None::<&fn(&[u8]) -> Option<ValueDefinedCostType>>);
| |___________________________________________________________________________________^
|
help: use `let _ = ...` to ignore the resulting value
|
392 | let _ = self.merk
| +++++++
|
unused `std::result::Result` that must be used:
merk/src/merk/restore.rs#L390
warning: unused `std::result::Result` that must be used
--> merk/src/merk/restore.rs:390:13
|
390 | self.rewrite_heights();
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
390 | let _ = self.rewrite_heights();
| +++++++
|
unused `grovedb_costs::CostContext` that must be used:
merk/src/merk/restore.rs#L385
warning: unused `grovedb_costs::CostContext` that must be used
--> merk/src/merk/restore.rs:385:9
|
385 | / self.merk
386 | | .load_base_root(None::<&fn(&[u8]) -> Option<ValueDefinedCostType>>);
| |_______________________________________________________________________________^
|
help: use `let _ = ...` to ignore the resulting value
|
385 | let _ = self.merk
| +++++++
|
unused `grovedb_costs::CostContext` that must be used:
merk/src/merk/restore.rs#L97
warning: unused `grovedb_costs::CostContext` that must be used
--> merk/src/merk/restore.rs:97:13
|
97 | self.merk.set_base_root_key(Some(chunk_tree.key().to_vec()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
97 | let _ = self.merk.set_base_root_key(Some(chunk_tree.key().to_vec()));
| +++++++
|
this function has too many arguments (8/7):
merk/src/tree/mod.rs#L811
warning: this function has too many arguments (8/7)
--> merk/src/tree/mod.rs:811:5
|
811 | / pub fn put_value_with_reference_value_hash_and_value_cost(
812 | | mut self,
813 | | value: Vec<u8>,
814 | | value_hash: CryptoHash,
... |
833 | | >,
834 | | ) -> CostResult<Self, Error> {
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
this function has too many arguments (8/7):
merk/src/tree/walk/mod.rs#L344
warning: this function has too many arguments (8/7)
--> merk/src/tree/walk/mod.rs:344:5
|
344 | / pub fn put_value_with_reference_value_hash_and_value_cost(
345 | | mut self,
346 | | value: Vec<u8>,
347 | | value_hash: CryptoHash,
... |
366 | | >,
367 | | ) -> CostResult<Self, Error> {
| |________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
this function has too many arguments (9/7):
merk/src/tree/ops.rs#L718
warning: this function has too many arguments (9/7)
--> merk/src/tree/ops.rs:718:5
|
718 | / fn recurse<K: AsRef<[u8]>, C, V, U, R>(
719 | | self,
720 | | batch: &MerkBatch<K>,
721 | | mid: usize,
... |
727 | | section_removal_bytes: &mut R,
728 | | ) -> CostResult<(Option<Self>, KeyUpdates), Error>
| |______________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
merk/src/proofs/chunk/util.rs#L343
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> merk/src/proofs/chunk/util.rs:343:53
|
343 | pub fn traversal_instruction_as_string(instruction: &Vec<bool>) -> String {
| ^^^^^^^^^^ help: change this to: `&[bool]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
module has the same name as its containing module:
merk/src/proofs/chunk.rs#L33
warning: module has the same name as its containing module
--> merk/src/proofs/chunk.rs:33:1
|
33 | pub mod chunk;
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `#[warn(clippy::module_inception)]` on by default
|
needlessly taken reference of both operands:
merk/src/merk/mod.rs#L656
warning: needlessly taken reference of both operands
--> merk/src/merk/mod.rs:656:12
|
656 | if &node.hash().unwrap() != &hash {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref
= note: `#[warn(clippy::op_ref)]` on by default
help: use the values directly
|
656 | if node.hash().unwrap() != hash {
| ~~~~~~~~~~~~~~~~~~~~ ~~~~
|
this function has too many arguments (8/7):
merk/src/merk/apply.rs#L277
warning: this function has too many arguments (8/7)
--> merk/src/merk/apply.rs:277:5
|
277 | / pub fn apply_unchecked<KB, KA, C, V, U, R>(
278 | | &mut self,
279 | | batch: &MerkBatch<KB>,
280 | | aux: &AuxMerkBatch<KA>,
... |
285 | | section_removal_bytes: &mut R,
286 | | ) -> CostResult<(), Error>
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
|
this function has too many arguments (8/7):
merk/src/merk/apply.rs#L176
warning: this function has too many arguments (8/7)
--> merk/src/merk/apply.rs:176:5
|
176 | / pub fn apply_with_costs_just_in_time_value_update<KB, KA>(
177 | | &mut self,
178 | | batch: &MerkBatch<KB>,
179 | | aux: &AuxMerkBatch<KA>,
... |
198 | | >,
199 | | ) -> CostResult<(), Error>
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
|
very complex type used. Consider factoring parts into `type` definitions:
merk/src/merk/chunks.rs#L372
warning: very complex type used. Consider factoring parts into `type` definitions
--> merk/src/merk/chunks.rs:372:33
|
372 | fn next_chunk(&mut self) -> Option<Result<(Vec<Op>, Option<String>), Error>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
|
struct `ChunkProducer` has a public `len` method, but no `is_empty` method:
merk/src/merk/chunks.rs#L363
warning: struct `ChunkProducer` has a public `len` method, but no `is_empty` method
--> merk/src/merk/chunks.rs:363:5
|
363 | pub fn len(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
= note: `#[warn(clippy::len_without_is_empty)]` on by default
|
method `child_heights_mut` is never used:
merk/src/tree/link.rs#L258
warning: method `child_heights_mut` is never used
--> merk/src/tree/link.rs:258:19
|
107 | impl Link {
| --------- method in this implementation
...
258 | pub(crate) fn child_heights_mut(&mut self) -> &mut (u8, u8) {
| ^^^^^^^^^^^^^^^^^
|
method `sum` is never used:
merk/src/proofs/tree.rs#L323
warning: method `sum` is never used
--> merk/src/proofs/tree.rs:323:19
|
131 | impl Tree {
| --------- method in this implementation
...
323 | pub(crate) fn sum(&self) -> Option<i64> {
| ^^^
|
multiple associated items are never used:
merk/src/merk/restore.rs#L68
warning: multiple associated items are never used
--> merk/src/merk/restore.rs:68:12
|
65 | impl<'db, S: StorageContext<'db>> Restorer<S> {
| --------------------------------------------- associated items in this implementation
...
68 | pub fn new(merk: Merk<S>, expected_root_hash: CryptoHash) -> Self {
| ^^^
...
82 | pub fn process_chunk(
| ^^^^^^^^^^^^^
...
117 | pub fn process_multi_chunk(&mut self, multi_chunk: Vec<ChunkOp>) -> Result<Vec<String>, Error> {
| ^^^^^^^^^^^^^^^^^^^
...
147 | fn verify_chunk(chunk: Vec<Op>, expected_root_hash: &CryptoHash) -> Result<ProofTree, Error> {
| ^^^^^^^^^^^^
...
184 | fn write_chunk(
| ^^^^^^^^^^^
...
252 | fn rewrite_parent_link(
| ^^^^^^^^^^^^^^^^^^^
...
303 | fn rewrite_heights(&mut self) -> Result<(), Error> {
| ^^^^^^^^^^^^^^^
...
362 | fn attempt_state_recovery(&mut self) -> Result<(), Error> {
| ^^^^^^^^^^^^^^^^^^^^^^
...
376 | pub fn finalize(mut self) -> Result<Merk<S>, Error> {
| ^^^^^^^^
...
407 | fn verify_height(&self) -> Result<(), Error> {
| ^^^^^^^^^^^^^
...
418 | fn verify_tree_height(&self, tree: &TreeNode, parent_height: u8) -> Result<(), Error> {
| ^^^^^^^^^^^^^^^^^^
|
struct `Restorer` is never constructed:
merk/src/merk/restore.rs#L58
warning: struct `Restorer` is never constructed
--> merk/src/merk/restore.rs:58:12
|
58 | pub struct Restorer<S> {
| ^^^^^^^^
|
associated function `get_chunk_encoding_length` is never used:
merk/src/merk/chunks.rs#L392
warning: associated function `get_chunk_encoding_length` is never used
--> merk/src/merk/chunks.rs:392:8
|
104 | impl<'db, S> ChunkProducer<'db, S>
| ---------------------------------- associated function in this implementation
...
392 | fn get_chunk_encoding_length(chunk: &[Op]) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
function `fetch_node` is never used:
merk/src/merk/mod.rs#L674
warning: function `fetch_node` is never used
--> merk/src/merk/mod.rs:674:4
|
674 | fn fetch_node<'db>(
| ^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
value assigned to `chunk_byte_length` is never read:
merk/src/merk/chunks.rs#L285
warning: value assigned to `chunk_byte_length` is never read
--> merk/src/merk/chunks.rs:285:17
|
285 | let mut chunk_byte_length = 0;
| ^^^^^^^^^^^^^^^^^
|
= help: maybe it is overwritten before being read?
= note: `#[warn(unused_assignments)]` on by default
|
Code Coverage
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|