Skip to content

feat: db state sync by merk chunking #459

feat: db state sync by merk chunking

feat: db state sync by merk chunking #459

Triggered via pull request April 26, 2024 14:55
Status Failure
Total duration 6m 36s
Artifacts

grovedb.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

2 errors and 102 warnings
Compilation errors
Process completed with exit code 101.
Tests
Process completed with exit code 101.
Dependencies security audit
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: styfle/[email protected], actions/checkout@v2, actions-rs/audit-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Dependencies security audit
The following actions uses node12 which is deprecated and will be forced to run on node16: styfle/[email protected], actions/checkout@v2, actions-rs/audit-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Dependencies security audit
2 warnings found!
Dependencies security audit
Unknown warning kind unsound found, please, file a bug
Formatting
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: styfle/[email protected], actions/checkout@v2, actions-rs/toolchain@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Formatting
The following actions uses node12 which is deprecated and will be forced to run on node16: styfle/[email protected], actions/checkout@v2, actions-rs/toolchain@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Formatting
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Formatting
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Formatting
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Formatting
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Compilation errors
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: styfle/[email protected], actions/checkout@v2, actions-rs/toolchain@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Compilation errors
The following actions uses node12 which is deprecated and will be forced to run on node16: styfle/[email protected], actions/checkout@v2, actions-rs/toolchain@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Compilation errors
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Compilation errors
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Compilation errors
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Compilation errors
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Tests
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: styfle/[email protected], actions/checkout@v2, actions-rs/toolchain@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Tests
The following actions uses node12 which is deprecated and will be forced to run on node16: styfle/[email protected], actions/checkout@v2, actions-rs/toolchain@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Tests
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Tests
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Tests
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Tests
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
variable `CHUNK_PREFIX_LENGTH` should have a snake case name: grovedb/src/lib.rs#L1376
warning: variable `CHUNK_PREFIX_LENGTH` should have a snake case name --> grovedb/src/lib.rs:1376:9 | 1376 | let CHUNK_PREFIX_LENGTH: usize = 32; | ^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `chunk_prefix_length`
variable `CHUNK_PREFIX_LENGTH` should have a snake case name: grovedb/src/lib.rs#L1146
warning: variable `CHUNK_PREFIX_LENGTH` should have a snake case name --> grovedb/src/lib.rs:1146:13 | 1146 | let CHUNK_PREFIX_LENGTH: usize = 32; | ^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `chunk_prefix_length` | = note: `#[warn(non_snake_case)]` on by default
unused `std::result::Result` that must be used: /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/macros/mod.rs#L606
warning: unused `std::result::Result` that must be used --> grovedb/src/lib.rs:280:13 | 280 | / write!( 281 | | f, 282 | | " prefix:{:?} -> path:{:?}\n", 283 | | hex::encode(prefix), 284 | | metadata_path_str 285 | | ); | |_____________^ | = note: this `Result` may be an `Err` variant, which should be handled = note: `#[warn(unused_must_use)]` on by default = note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
unneeded `return` statement: grovedb/src/lib.rs#L1391
warning: unneeded `return` statement --> grovedb/src/lib.rs:1391:13 | 1391 | / return Err(Error::CorruptedData( 1392 | | "unable to convert chunk id to string".to_string(), 1393 | | )) | |______________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 1391 ~ Err(Error::CorruptedData( 1392 + "unable to convert chunk id to string".to_string(), 1393 + )) |
unnecessary use of `to_vec`: grovedb/src/lib.rs#L1365
warning: unnecessary use of `to_vec` --> grovedb/src/lib.rs:1365:20 | 1365 | for subtree in path.to_vec() { | ^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned = note: `#[warn(clippy::unnecessary_to_owned)]` on by default help: use | 1365 | for subtree in path { | ~~~~ help: remove this `&` | 1366 - let string = std::str::from_utf8(&subtree).unwrap(); 1366 + let string = std::str::from_utf8(subtree).unwrap(); |
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: grovedb/src/lib.rs#L1363
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> grovedb/src/lib.rs:1363:34 | 1363 | pub fn util_path_to_string(path: &Vec<Vec<u8>>) -> Vec<String> { | ^^^^^^^^^^^^^ help: change this to: `&[Vec<u8>]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
this expression creates a reference which is immediately dereferenced by the compiler: grovedb/src/lib.rs#L1265
warning: this expression creates a reference which is immediately dereferenced by the compiler --> grovedb/src/lib.rs:1265:67 | 1265 | let (chunk_prefix, chunk_id) = util_split_global_chunk_id(&global_chunk_id)?; | ^^^^^^^^^^^^^^^^ help: change this to: `global_chunk_id` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this boolean expression can be simplified: grovedb/src/lib.rs#L1315
warning: this boolean expression can be simplified --> grovedb/src/lib.rs:1315:28 | 1315 | if (!restorer.finalize().is_ok()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `restorer.finalize().is_err()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool = note: `#[warn(clippy::nonminimal_bool)]` on by default
this expression creates a reference which is immediately dereferenced by the compiler: grovedb/src/lib.rs#L1168
warning: this expression creates a reference which is immediately dereferenced by the compiler --> grovedb/src/lib.rs:1168:67 | 1168 | .open_transactional_merk_at_path(path.into(), &tx, None) | ^^^ help: change this to: `tx` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
this expression creates a reference which is immediately dereferenced by the compiler: grovedb/src/lib.rs#L1159
warning: this expression creates a reference which is immediately dereferenced by the compiler --> grovedb/src/lib.rs:1159:60 | 1159 | let subtrees_metadata = self.get_subtrees_metadata(&tx)?; | ^^^ help: change this to: `tx` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
unneeded `return` statement: grovedb/src/lib.rs#L1197
warning: unneeded `return` statement --> grovedb/src/lib.rs:1197:17 | 1197 | return Err(Error::CorruptedData("Prefix not found".to_string())); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 1197 - return Err(Error::CorruptedData("Prefix not found".to_string())); 1197 + Err(Error::CorruptedData("Prefix not found".to_string())) |
unneeded `return` statement: grovedb/src/lib.rs#L1190
warning: unneeded `return` statement --> grovedb/src/lib.rs:1190:25 | 1190 | / return Err(Error::CorruptedData( 1191 | | "Unable to create Chunk producer".to_string(), 1192 | | )); | |__________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 1190 ~ Err(Error::CorruptedData( 1191 + "Unable to create Chunk producer".to_string(), 1192 ~ )) |
unneeded `return` statement: grovedb/src/lib.rs#L1183
warning: unneeded `return` statement --> grovedb/src/lib.rs:1183:33 | 1183 | / ... return Err(Error::CorruptedData( 1184 | | ... "Unable to create to load chunk".to_string(), 1185 | | ... )); | |________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return = note: `#[warn(clippy::needless_return)]` on by default help: remove `return` | 1183 ~ Err(Error::CorruptedData( 1184 + "Unable to create to load chunk".to_string(), 1185 ~ )) |
very complex type used. Consider factoring parts into `type` definitions: grovedb/src/lib.rs#L1006
warning: very complex type used. Consider factoring parts into `type` definitions --> grovedb/src/lib.rs:1006:10 | 1006 | ) -> 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#L936
warning: very complex type used. Consider factoring parts into `type` definitions --> grovedb/src/lib.rs:936:10 | 936 | ) -> 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#L910
warning: very complex type used. Consider factoring parts into `type` definitions --> grovedb/src/lib.rs:910:10 | 910 | ) -> 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
using `write!()` with a format string that ends in a single newline: grovedb/src/lib.rs#L280
warning: using `write!()` with a format string that ends in a single newline --> grovedb/src/lib.rs:280:13 | 280 | / write!( 281 | | f, 282 | | " prefix:{:?} -> path:{:?}\n", 283 | | hex::encode(prefix), 284 | | metadata_path_str 285 | | ); | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline = note: `#[warn(clippy::write_with_newline)]` on by default help: use `writeln!` instead | 280 ~ writeln!( 281 | f, 282 ~ " prefix:{:?} -> path:{:?}", |
this expression creates a reference which is immediately dereferenced by the compiler: grovedb/src/lib.rs#L279
warning: this expression creates a reference which is immediately dereferenced by the compiler --> grovedb/src/lib.rs:279:57 | 279 | let metadata_path_str = util_path_to_string(&metadata_path); | ^^^^^^^^^^^^^^ help: change this to: `metadata_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
you should consider adding a `Default` implementation for `SubtreesMetadata`: grovedb/src/lib.rs#L268
warning: you should consider adding a `Default` implementation for `SubtreesMetadata` --> grovedb/src/lib.rs:268:5 | 268 | / pub fn new() -> SubtreesMetadata { 269 | | SubtreesMetadata { 270 | | data: BTreeMap::new(), 271 | | } 272 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default = note: `#[warn(clippy::new_without_default)]` on by default help: try adding this | 267 + impl Default for SubtreesMetadata { 268 + fn default() -> Self { 269 + Self::new() 270 + } 271 + } |
this function has too many arguments (9/7): grovedb/src/operations/proof/generate.rs#L488
warning: this function has too many arguments (9/7) --> grovedb/src/operations/proof/generate.rs:488:5 | 488 | / fn generate_and_store_merk_proof<'a, S, B>( 489 | | &self, 490 | | path: &SubtreePath<B>, 491 | | subtree: &'a Merk<S>, ... | 497 | | key: &[u8], 498 | | ) -> 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 (11/7): grovedb/src/element/query.rs#L546
warning: this function has too many arguments (11/7) --> grovedb/src/element/query.rs:546:5 | 546 | / fn query_item( 547 | | storage: &RocksDbStorage, 548 | | item: &QueryItem, 549 | | results: &mut Vec<QueryResultElement>, ... | 557 | | add_element_function: fn(PathQueryPushArgs) -> CostResult<(), Error>, 558 | | ) -> 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
this `let...else` may be rewritten with the `?` operator: grovedb/src/element/helpers.rs#L319
warning: this `let...else` may be rewritten with the `?` operator --> grovedb/src/element/helpers.rs:319:9 | 319 | / let Some(value_cost) = self.get_specialized_cost().ok() else { 320 | | return None; 321 | | }; | |__________^ help: replace it with: `let value_cost = self.get_specialized_cost().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
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: grovedb/src/element/helpers.rs#L248
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> grovedb/src/element/helpers.rs:248:14 | 248 | 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
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: grovedb/src/batch/mod.rs#L555
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> grovedb/src/batch/mod.rs:555:50 | 555 | pub fn verify_consistency_of_operations(ops: &Vec<GroveDbOp>) -> GroveDbOpConsistencyResults { | ^^^^^^^^^^^^^^^ help: change this to: `&[GroveDbOp]` | = 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
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> { | ^^^^^^^^^^^^^^^^^^
field `version` is never read: grovedb/src/lib.rs#L239
warning: field `version` is never read --> grovedb/src/lib.rs:239:5 | 235 | pub struct GroveDb { | ------- field in this struct ... 239 | version: i32, | ^^^^^^^ | = note: `#[warn(dead_code)]` on by default
unused variable: `v_path`: grovedb/src/lib.rs#L1323
warning: unused variable: `v_path` --> grovedb/src/lib.rs:1323:29 | 1323 | let v_path = &value.0; | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_v_path` | = note: `#[warn(unused_variables)]` on by default
variable does not need to be mutable: grovedb/src/lib.rs#L1175
warning: variable does not need to be mutable --> grovedb/src/lib.rs:1175:21 | 1175 | let mut chunk_producer_res = ChunkProducer::new(&merk); | ----^^^^^^^^^^^^^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default
unnecessary parentheses around `if` condition: grovedb/src/lib.rs#L1315
warning: unnecessary parentheses around `if` condition --> grovedb/src/lib.rs:1315:28 | 1315 | if (!restorer.finalize().is_ok()) { | ^ ^ | help: remove these parentheses | 1315 - if (!restorer.finalize().is_ok()) { 1315 + if !restorer.finalize().is_ok() { |
unnecessary parentheses around `if` condition: grovedb/src/lib.rs#L1314
warning: unnecessary parentheses around `if` condition --> grovedb/src/lib.rs:1314:24 | 1314 | if (state_sync_info.num_processed_chunks > 0) { | ^ ^ | help: remove these parentheses | 1314 - if (state_sync_info.num_processed_chunks > 0) { 1314 + if state_sync_info.num_processed_chunks > 0 { |
this `if` statement can be collapsed: grovedb/src/lib.rs#L1314
warning: this `if` statement can be collapsed --> grovedb/src/lib.rs:1314:21 | 1314 | / if (state_sync_info.num_processed_chunks > 0) { 1315 | | if (!restorer.finalize().is_ok()) { 1316 | | return Err(Error::InternalError("Unable to finalize merk")); 1317 | | } 1318 | | } | |_____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if = note: `#[warn(clippy::collapsible_if)]` on by default help: collapse nested if block | 1314 ~ if (state_sync_info.num_processed_chunks > 0) && (!restorer.finalize().is_ok()) { 1315 + return Err(Error::InternalError("Unable to finalize merk")); 1316 + } |
unnecessary parentheses around `if` condition: grovedb/src/lib.rs#L1306
warning: unnecessary parentheses around `if` condition --> grovedb/src/lib.rs:1306:16 | 1306 | if (!state_sync_info.pending_chunks.is_empty()) { | ^ ^ | help: remove these parentheses | 1306 - if (!state_sync_info.pending_chunks.is_empty()) { 1306 + if !state_sync_info.pending_chunks.is_empty() { |
unnecessary parentheses around `if` condition: grovedb/src/lib.rs#L1305
warning: unnecessary parentheses around `if` condition --> grovedb/src/lib.rs:1305:12 | 1305 | if (res.is_empty()) { | ^ ^ | help: remove these parentheses | 1305 - if (res.is_empty()) { 1305 + if res.is_empty() { |
unnecessary parentheses around `if` condition: grovedb/src/lib.rs#L1281
warning: unnecessary parentheses around `if` condition --> grovedb/src/lib.rs:1281:20 | 1281 | if (!chunk_data.is_empty()) { | ^ ^ | help: remove these parentheses | 1281 - if (!chunk_data.is_empty()) { 1281 + if !chunk_data.is_empty() { |
unnecessary parentheses around `if` condition: grovedb/src/lib.rs#L1275
warning: unnecessary parentheses around `if` condition --> grovedb/src/lib.rs:1275:20 | 1275 | if (!state_sync_info.pending_chunks.contains(global_chunk_id)) { | ^ ^ | help: remove these parentheses | 1275 - if (!state_sync_info.pending_chunks.contains(global_chunk_id)) { 1275 + if !state_sync_info.pending_chunks.contains(global_chunk_id) { |
unnecessary parentheses around `if` condition: grovedb/src/lib.rs#L1272
warning: unnecessary parentheses around `if` condition --> grovedb/src/lib.rs:1272:20 | 1272 | if (*current_prefix != chunk_prefix) { | ^ ^ | help: remove these parentheses | 1272 - if (*current_prefix != chunk_prefix) { 1272 + if *current_prefix != chunk_prefix { |
unnecessary parentheses around `if` condition: grovedb/src/lib.rs#L1171
warning: unnecessary parentheses around `if` condition --> grovedb/src/lib.rs:1171:20 | 1171 | if (merk.is_empty_tree().unwrap()) { | ^ ^ | help: remove these parentheses | 1171 - if (merk.is_empty_tree().unwrap()) { 1171 + if merk.is_empty_tree().unwrap() { |
unnecessary parentheses around `if` condition: grovedb/src/lib.rs#L1147
warning: unnecessary parentheses around `if` condition --> grovedb/src/lib.rs:1147:12 | 1147 | if (global_chunk_id.len() < CHUNK_PREFIX_LENGTH) { | ^ ^ | help: remove these parentheses | 1147 - if (global_chunk_id.len() < CHUNK_PREFIX_LENGTH) { 1147 + if global_chunk_id.len() < CHUNK_PREFIX_LENGTH { |
unnecessary parentheses around `if` condition: grovedb/src/lib.rs#L1095
warning: unnecessary parentheses around `if` condition --> grovedb/src/lib.rs:1095:16 | 1095 | if (parent_path_opt.is_some()) { | ^ ^ | = note: `#[warn(unused_parens)]` on by default help: remove these parentheses | 1095 - if (parent_path_opt.is_some()) { 1095 + if parent_path_opt.is_some() { |
unused import: `grovedb_costs::storage_cost::key_value_cost::KeyValueStorageCost`: grovedb/src/lib.rs#L181
warning: unused import: `grovedb_costs::storage_cost::key_value_cost::KeyValueStorageCost` --> grovedb/src/lib.rs:181:5 | 181 | use grovedb_costs::storage_cost::key_value_cost::KeyValueStorageCost; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
this import is redundant: grovedb/src/lib.rs#L174
warning: this import is redundant --> grovedb/src/lib.rs:174:1 | 174 | use blake3; | ^^^^^^^^^^^ help: remove it entirely | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports = note: `#[warn(clippy::single_component_path_imports)]` on by default
unused import: `storage_context_optional_tx`: grovedb/src/operations/delete/mod.rs#L62
warning: unused import: `storage_context_optional_tx` --> grovedb/src/operations/delete/mod.rs:62:12 | 62 | util::{storage_context_optional_tx, storage_context_with_parent_optional_tx}, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
unused imports: `KVIterator`, `proofs::Query`: grovedb/src/operations/auxiliary.rs#L36
warning: unused imports: `KVIterator`, `proofs::Query` --> grovedb/src/operations/auxiliary.rs:36:20 | 36 | use grovedb_merk::{proofs::Query, KVIterator}; | ^^^^^^^^^^^^^ ^^^^^^^^^^ | = note: `#[warn(unused_imports)]` 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#L418
warning: unused `grovedb_costs::CostContext` that must be used --> merk/src/merk/restore.rs:418:13 | 418 | / self.merk 419 | | .load_base_root(None::<&fn(&[u8]) -> Option<ValueDefinedCostType>>); | |___________________________________________________________________________________^ | help: use `let _ = ...` to ignore the resulting value | 418 | let _ = self.merk | +++++++
unused `std::result::Result` that must be used: merk/src/merk/restore.rs#L416
warning: unused `std::result::Result` that must be used --> merk/src/merk/restore.rs:416:13 | 416 | self.rewrite_heights(); | ^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled help: use `let _ = ...` to ignore the resulting value | 416 | let _ = self.rewrite_heights(); | +++++++
unused `grovedb_costs::CostContext` that must be used: merk/src/merk/restore.rs#L411
warning: unused `grovedb_costs::CostContext` that must be used --> merk/src/merk/restore.rs:411:9 | 411 | / self.merk 412 | | .load_base_root(None::<&fn(&[u8]) -> Option<ValueDefinedCostType>>); | |_______________________________________________________________________________^ | help: use `let _ = ...` to ignore the resulting value | 411 | let _ = self.merk | +++++++
unused `grovedb_costs::CostContext` that must be used: merk/src/merk/restore.rs#L107
warning: unused `grovedb_costs::CostContext` that must be used --> merk/src/merk/restore.rs:107:13 | 107 | 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 | 107 | 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#L665
warning: needlessly taken reference of both operands --> merk/src/merk/mod.rs:665:12 | 665 | 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 | 665 | if node.hash().unwrap() != hash { | ~~~~~~~~~~~~~~~~~~~~ ~~~~
this expression creates a reference which is immediately dereferenced by the compiler: merk/src/merk/restore.rs#L190
warning: this expression creates a reference which is immediately dereferenced by the compiler --> merk/src/merk/restore.rs:190:50 | 190 | let combined_hash = combine_hash(&val_hash, &tree.hash().unwrap()).unwrap(); | ^^^^^^^^^ help: change this to: `val_hash` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default
this let-binding has unit value: merk/src/merk/restore.rs#L188
warning: this let-binding has unit value --> merk/src/merk/restore.rs:188:9 | 188 | / let parent_key_value_hash = match parent_key_value_hash_opt { 189 | | Some(val_hash) => { 190 | | let combined_hash = combine_hash(&val_hash, &tree.hash().unwrap()).unwrap(); 191 | | if &combined_hash != expected_root_hash { ... | 203 | | } 204 | | }; | |__________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value = note: `#[warn(clippy::let_unit_value)]` on by default help: omit the `let` binding | 188 ~ match parent_key_value_hash_opt { 189 + Some(val_hash) => { 190 + let combined_hash = combine_hash(&val_hash, &tree.hash().unwrap()).unwrap(); 191 + if &combined_hash != expected_root_hash { 192 + return Err(Error::ChunkRestoringError(ChunkError::InvalidChunkProof( 193 + "chunk doesn't match expected root hash", 194 + ))); 195 + } 196 + } 197 + None => { 198 + if &tree.hash().unwrap() != expected_root_hash { 199 + return Err(Error::ChunkRestoringError(ChunkError::InvalidChunkProof( 200 + "chunk doesn't match expected root hash", 201 + ))); 202 + } 203 + } 204 + }; |
using `clone` on type `Option<[u8; 32]>` which implements the `Copy` trait: merk/src/merk/restore.rs#L100
warning: using `clone` on type `Option<[u8; 32]>` which implements the `Copy` trait --> merk/src/merk/restore.rs:100:37 | 100 | parent_key_value_hash = self.parent_key_value_hash.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.parent_key_value_hash` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
length comparison to zero: merk/src/merk/restore.rs#L99
warning: length comparison to zero --> merk/src/merk/restore.rs:99:13 | 99 | if (chunk_id.len() == 0) { | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `chunk_id.is_empty()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero = note: `#[warn(clippy::len_zero)]` on by default
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 `attempt_state_recovery` is never used: merk/src/merk/restore.rs#L388
warning: method `attempt_state_recovery` is never used --> merk/src/merk/restore.rs:388:8 | 67 | impl<'db, S: StorageContext<'db>> Restorer<S> { | --------------------------------------------- method in this implementation ... 388 | fn attempt_state_recovery(&mut self) -> Result<(), Error> { | ^^^^^^^^^^^^^^^^^^^^^^
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> 105 | | where 106 | | S: StorageContext<'db>, | |___________________________- associated function in this implementation ... 392 | fn get_chunk_encoding_length(chunk: &[Op]) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
unused variable: `parent_key_value_hash`: merk/src/merk/restore.rs#L188
warning: unused variable: `parent_key_value_hash` --> merk/src/merk/restore.rs:188:13 | 188 | let parent_key_value_hash = match parent_key_value_hash_opt { | ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_parent_key_value_hash` | = note: `#[warn(unused_variables)]` 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
this `if` statement can be collapsed: merk/src/merk/mod.rs#L672
warning: this `if` statement can be collapsed --> merk/src/merk/mod.rs:672:9 | 672 | / if !skip_sum_checks { 673 | | if node.sum().unwrap() != sum { 674 | | bad_link_map.insert(instruction_id.clone(), hash); 675 | | parent_keys.insert(instruction_id, parent_key.to_vec()); 676 | | return; 677 | | } 678 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if = note: `#[warn(clippy::collapsible_if)]` on by default help: collapse nested if block | 672 ~ if !skip_sum_checks && node.sum().unwrap() != sum { 673 + bad_link_map.insert(instruction_id.clone(), hash); 674 + parent_keys.insert(instruction_id, parent_key.to_vec()); 675 + return; 676 + } |
unused import: `BatchEntry`: merk/src/merk/mod.rs#L74
warning: unused import: `BatchEntry` --> merk/src/merk/mod.rs:74:5 | 74 | BatchEntry, | ^^^^^^^^^^
unnecessary parentheses around `if` condition: merk/src/merk/restore.rs#L99
warning: unnecessary parentheses around `if` condition --> merk/src/merk/restore.rs:99:12 | 99 | if (chunk_id.len() == 0) { | ^ ^ | = note: `#[warn(unused_parens)]` on by default help: remove these parentheses | 99 - if (chunk_id.len() == 0) { 99 + if chunk_id.len() == 0 { |
unused imports: `NoopCommit`, `committer::MerkCommitter`: merk/src/merk/restore.rs#L39
warning: unused imports: `NoopCommit`, `committer::MerkCommitter` --> merk/src/merk/restore.rs:39:12 | 39 | merk::{committer::MerkCommitter, MerkSource}, | ^^^^^^^^^^^^^^^^^^^^^^^^ ... 50 | tree::{combine_hash, kv::ValueDefinedCostType, NoopCommit, RefWalker, TreeNode}, | ^^^^^^^^^^
unused import: `grovedb_costs::cost_return_on_error`: merk/src/merk/restore.rs#L34
warning: unused import: `grovedb_costs::cost_return_on_error` --> merk/src/merk/restore.rs:34:5 | 34 | use grovedb_costs::cost_return_on_error; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
'test' may be misspelled as 'tests': merk/src/tree/fuzz_tests.rs#L31
warning: 'test' may be misspelled as 'tests' --> merk/src/tree/fuzz_tests.rs:31:8 | 31 | #![cfg(tests)] | ^^^^^ help: did you mean: `test` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#maybe_misused_cfg = note: `#[warn(clippy::maybe_misused_cfg)]` on by default
Linting
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: styfle/[email protected], actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Linting
The following actions uses node12 which is deprecated and will be forced to run on node16: styfle/[email protected], actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Linting
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Linting
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Linting
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Linting
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/