From 0cffae5dd08c81604a74e56c32b4c6c4083c4428 Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 12 Oct 2023 07:18:02 +1000 Subject: [PATCH 1/2] Remove unused dependency exceptions (#7726) --- deny.toml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/deny.toml b/deny.toml index 8e149b0bfbd..fcb321d3a67 100644 --- a/deny.toml +++ b/deny.toml @@ -63,15 +63,6 @@ skip-tree = [ # wait for rocksdb to upgrade { name = "bindgen", version = "=0.65.1" }, - # wait for console-subscriber to upgrade - { name = "prost-derive", version = "=0.11.9" }, - - # wait for console-subscriber to upgrade - { name = "prost-types", version = "=0.11.9" }, - - # wait for console-subscriber to upgrade - { name = "tonic", version = "=0.9.2" }, - # wait for tracing and many other crates to upgrade # this duplicate dependency currently only exists in testing builds { name = "regex-syntax", version = "=0.6.29" }, From 581829ddbd1ae301029365e2a12972dea751b407 Mon Sep 17 00:00:00 2001 From: arya2 Date: Wed, 11 Oct 2023 18:28:55 -0400 Subject: [PATCH 2/2] Uses range_iter in address_transaction_locations --- .../finalized_state/zebra_db/transparent.rs | 42 +++++-------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/zebra-state/src/service/finalized_state/zebra_db/transparent.rs b/zebra-state/src/service/finalized_state/zebra_db/transparent.rs index 2f80751687f..6d8b616ae6e 100644 --- a/zebra-state/src/service/finalized_state/zebra_db/transparent.rs +++ b/zebra-state/src/service/finalized_state/zebra_db/transparent.rs @@ -235,44 +235,24 @@ impl ZebraDb { let tx_loc_by_transparent_addr_loc = self.db.cf_handle("tx_loc_by_transparent_addr_loc").unwrap(); - // Manually fetch the entire addresses' transaction locations - let mut addr_transactions = BTreeSet::new(); - // A potentially invalid key representing the first UTXO send to the address, // or the query start height. - let mut transaction_location = AddressTransaction::address_iterator_start( + let transaction_location = AddressTransaction::address_iterator_start( address_location, *query_height_range.start(), ); - loop { - // Seek to a valid entry for this address, or the first entry for the next address - transaction_location = match self - .db - .zs_next_key_value_from(&tx_loc_by_transparent_addr_loc, &transaction_location) - { - Some((transaction_location, ())) => transaction_location, - // We're finished with the final address in the column family - None => break, - }; - - // We found the next address, so we're finished with this address - if transaction_location.address_location() != address_location { - break; - } - - // We're past the end height, so we're finished with this query - if transaction_location.transaction_location().height > *query_height_range.end() { - break; - } - - addr_transactions.insert(transaction_location); - - // A potentially invalid key representing the next possible output - transaction_location.address_iterator_next(); - } + let last_transaction_location = AddressTransaction::new( + address_location, + TransactionLocation::from_usize(*query_height_range.end(), usize::MAX), + ); - addr_transactions + self.zs_range_iter( + &tx_loc_by_transparent_addr_loc, + &transaction_location..=&last_transaction_location, + ) + .map(|(tx_loc, ())| tx_loc) + .collect() } // Address index queries