Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: state sync optimization #346

Merged
merged 10 commits into from
Jan 6, 2025

fix: build for verify feature

5098940
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

feat: state sync optimization #346

fix: build for verify feature
5098940
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Dec 30, 2024 in 1s

clippy

98 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 98
Note 0
Help 0

Versions

  • rustc 1.83.0 (90b35a623 2024-11-26)
  • cargo 1.83.0 (5ffbef321 2024-10-29)
  • clippy 0.1.83 (90b35a6 2024-11-26)

Annotations

Check warning on line 1232 in grovedb/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
    --> grovedb/src/lib.rs:1223:5
     |
1223 | /     fn verify_merk_and_submerks_in_transaction<'db, B: AsRef<[u8]>, S: StorageContext<'db>>(
1224 | |         &'db self,
1225 | |         merk: Merk<S>,
1226 | |         path: &SubtreePath<B>,
...    |
1231 | |         grove_version: &GroveVersion,
1232 | |     ) -> Result<VerificationIssues, Error> {
     | |__________________________________________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 512 in grovedb/src/query/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> grovedb/src/query/mod.rs:512:6
    |
512 | impl<'a> fmt::Display for SinglePathSubquery<'a> {
    |      ^^                                      ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
512 - impl<'a> fmt::Display for SinglePathSubquery<'a> {
512 + impl fmt::Display for SinglePathSubquery<'_> {
    |

Check warning on line 483 in grovedb/src/query/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> grovedb/src/query/mod.rs:483:6
    |
483 | impl<'a> HasSubquery<'a> {
    |      ^^              ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
483 - impl<'a> HasSubquery<'a> {
483 + impl HasSubquery<'_> {
    |

Check warning on line 467 in grovedb/src/query/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> grovedb/src/query/mod.rs:467:6
    |
467 | impl<'a> fmt::Display for HasSubquery<'a> {
    |      ^^                               ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
467 - impl<'a> fmt::Display for HasSubquery<'a> {
467 + impl fmt::Display for HasSubquery<'_> {
    |

Check warning on line 367 in grovedb/src/operations/proof/verify.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`

warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
   --> grovedb/src/operations/proof/verify.rs:367:25
    |
367 |                         limit_left.as_mut().map(|limit| *limit -= 1);
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |                         |
    |                         help: try: `if let Some(limit) = limit_left.as_mut() { ... }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn

Check warning on line 293 in grovedb/src/operations/proof/verify.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`

warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
   --> grovedb/src/operations/proof/verify.rs:293:17
    |
293 |                 limit_left.as_mut().map(|limit| *limit -= 1);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |                 |
    |                 help: try: `if let Some(limit) = limit_left.as_mut() { ... }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn
    = note: `#[warn(clippy::option_map_unit_fn)]` on by default

Check warning on line 238 in grovedb/src/operations/proof/verify.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/proof/verify.rs:229:5
    |
229 | /     fn verify_layer_proof<T>(
230 | |         layer_proof: &LayerProof,
231 | |         prove_options: &ProveOptions,
232 | |         query: &PathQuery,
...   |
237 | |         grove_version: &GroveVersion,
238 | |     ) -> Result<CryptoHash, Error>
    | |__________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 226 in grovedb/src/operations/insert/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/insert/mod.rs:217:5
    |
217 | /     fn add_element_on_transaction<'db, B: AsRef<[u8]>>(
218 | |         &'db self,
219 | |         path: SubtreePath<B>,
220 | |         key: &[u8],
...   |
225 | |         grove_version: &GroveVersion,
226 | |     ) -> CostResult<Merk<PrefixedRocksDbTransactionContext<'db>>, Error> {
    | |________________________________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 126 in grovedb/src/operations/insert/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/insert/mod.rs:117:5
    |
117 | /     fn insert_on_transaction<'db, 'b, B: AsRef<[u8]>>(
118 | |         &self,
119 | |         path: SubtreePath<'b, B>,
120 | |         key: &[u8],
...   |
125 | |         grove_version: &GroveVersion,
126 | |     ) -> CostResult<(), Error> {
    | |______________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 551 in grovedb/src/operations/get/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/get/query.rs:542:5
    |
542 | /     pub fn query_raw(
543 | |         &self,
544 | |         path_query: &PathQuery,
545 | |         allow_cache: bool,
...   |
550 | |         grove_version: &GroveVersion,
551 | |     ) -> CostResult<(QueryResultElements, u16), Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 240 in grovedb/src/operations/get/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/get/query.rs:231:5
    |
231 | /     pub fn query(
232 | |         &self,
233 | |         path_query: &PathQuery,
234 | |         allow_cache: bool,
...   |
239 | |         grove_version: &GroveVersion,
240 | |     ) -> CostResult<(QueryResultElements, u16), Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 123 in grovedb/src/operations/get/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/get/query.rs:114:5
    |
114 | /     pub fn query_many_raw(
115 | |         &self,
116 | |         path_queries: &[&PathQuery],
117 | |         allow_cache: bool,
...   |
122 | |         grove_version: &GroveVersion,
123 | |     ) -> CostResult<QueryResultElements, Error>
    | |_______________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 689 in grovedb/src/operations/delete/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/mod.rs:673:5
    |
673 | /     fn delete_internal_on_transaction<B: AsRef<[u8]>>(
674 | |         &self,
675 | |         path: SubtreePath<B>,
676 | |         key: &[u8],
...   |
688 | |         grove_version: &GroveVersion,
689 | |     ) -> CostResult<bool, Error> {
    | |________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 650 in grovedb/src/operations/delete/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/mod.rs:634:5
    |
634 | /     fn delete_internal<B: AsRef<[u8]>>(
635 | |         &self,
636 | |         path: SubtreePath<B>,
637 | |         key: &[u8],
...   |
649 | |         grove_version: &GroveVersion,
650 | |     ) -> CostResult<bool, Error> {
    | |________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 518 in grovedb/src/operations/delete/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/mod.rs:509:5
    |
509 | /     pub fn delete_operation_for_delete_internal<B: AsRef<[u8]>>(
510 | |         &self,
511 | |         path: SubtreePath<B>,
512 | |         key: &[u8],
...   |
517 | |         grove_version: &GroveVersion,
518 | |     ) -> CostResult<Option<QualifiedGroveDbOp>, Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 130 in grovedb/src/operations/delete/worst_case.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/worst_case.rs:121:5
    |
121 | /     pub fn worst_case_delete_operation_for_delete<'db, S: Storage<'db>>(
122 | |         path: &KeyInfoPath,
123 | |         key: &KeyInfo,
124 | |         parent_tree_is_sum_tree: bool,
...   |
129 | |         grove_version: &GroveVersion,
130 | |     ) -> CostResult<QualifiedGroveDbOp, Error> {
    | |______________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 208 in grovedb/src/operations/delete/delete_up_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/delete_up_tree.rs:199:5
    |
199 | /     pub fn add_delete_operations_for_delete_up_tree_while_empty<B: AsRef<[u8]>>(
200 | |         &self,
201 | |         path: SubtreePath<B>,
202 | |         key: &[u8],
...   |
207 | |         grove_version: &GroveVersion,
208 | |     ) -> CostResult<Option<Vec<QualifiedGroveDbOp>>, Error> {
    | |___________________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 176 in grovedb/src/operations/delete/delete_up_tree.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/delete_up_tree.rs:167:5
    |
167 | /     pub fn delete_operations_for_delete_up_tree_while_empty<B: AsRef<[u8]>>(
168 | |         &self,
169 | |         path: SubtreePath<B>,
170 | |         key: &[u8],
...   |
175 | |         grove_version: &GroveVersion,
176 | |     ) -> CostResult<Vec<QualifiedGroveDbOp>, Error> {
    | |___________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 148 in grovedb/src/operations/delete/average_case.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/operations/delete/average_case.rs:139:5
    |
139 | /     pub fn average_case_delete_operation_for_delete<'db, S: Storage<'db>>(
140 | |         path: &KeyInfoPath,
141 | |         key: &KeyInfo,
142 | |         parent_tree_is_sum_tree: bool,
...   |
147 | |         grove_version: &GroveVersion,
148 | |     ) -> CostResult<QualifiedGroveDbOp, Error> {
    | |______________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 743 in grovedb/src/element/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (12/7)

warning: this function has too many arguments (12/7)
   --> grovedb/src/element/query.rs:730:5
    |
730 | /     fn query_item(
731 | |         storage: &RocksDbStorage,
732 | |         item: &QueryItem,
733 | |         results: &mut Vec<QueryResultElement>,
...   |
742 | |         grove_version: &GroveVersion,
743 | |     ) -> CostResult<(), Error> {
    | |______________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 312 in grovedb/src/element/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
   --> grovedb/src/element/query.rs:303:5
    |
303 | /     pub fn get_query_apply_function(
304 | |         storage: &RocksDbStorage,
305 | |         path: &[&[u8]],
306 | |         sized_query: &SizedQuery,
...   |
311 | |         grove_version: &GroveVersion,
312 | |     ) -> CostResult<(QueryResultElements, u16), Error> {
    | |______________________________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments

Check warning on line 173 in grovedb/src/element/query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> grovedb/src/element/query.rs:173:17
    |
173 | impl<'db, 'ctx, 'a> fmt::Display for PathQueryPushArgs<'db, 'ctx, 'a>
    |                 ^^                                                ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
173 - impl<'db, 'ctx, 'a> fmt::Display for PathQueryPushArgs<'db, 'ctx, 'a>
173 + impl<'db, 'ctx> fmt::Display for PathQueryPushArgs<'db, 'ctx, '_>
    |

Check warning on line 330 in grovedb/src/element/helpers.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `let...else` may be rewritten with the `?` operator

warning: this `let...else` may be rewritten with the `?` operator
   --> grovedb/src/element/helpers.rs:328:9
    |
328 | /         let Some(value_cost) = self.get_specialized_cost(grove_version).ok() else {
329 | |             return None;
330 | |         };
    | |__________^ help: replace it with: `let value_cost = self.get_specialized_cost(grove_version).ok()?;`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
    = note: `#[warn(clippy::question_mark)]` on by default

Check warning on line 253 in grovedb/src/element/helpers.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
   --> grovedb/src/element/helpers.rs:253:14
    |
253 |         key: &Vec<u8>,
    |              ^^^^^^^^ help: change this to: `&[u8]`
    |
    = 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

Check warning on line 2470 in grovedb/src/batch/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
    --> grovedb/src/batch/mod.rs:2447:5
     |
2447 | /     pub fn apply_partial_batch_with_element_flags_update(
2448 | |         &self,
2449 | |         ops: Vec<QualifiedGroveDbOp>,
2450 | |         batch_apply_options: Option<BatchApplyOptions>,
...    |
2469 | |         grove_version: &GroveVersion,
2470 | |     ) -> CostResult<(), Error> {
     | |______________________________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments