Skip to content

Commit

Permalink
Bump lru from 0.7.8 to 0.8.1 and a few other dependencies (#1309)
Browse files Browse the repository at this point in the history
Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.7.8 to 0.8.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md">lru's
changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/jeromefroe/lru-rs/tree/0.8.1">v0.8.1</a>
- 2022-10-01</h2>
<ul>
<li>Add &quot;caching&quot; and &quot;no-std&quot; to list of
categories.</li>
</ul>
<h2><a href="https://github.com/jeromefroe/lru-rs/tree/0.8.0">v0.8.0</a>
- 2022-09-11</h2>
<ul>
<li>Use <code>NonZeroUsize</code> for LRU capacity instead of
usize.</li>
<li>Add <code>get_or_insert_mut</code> method which is similiar to
<code>get_or_insert</code> but returns a mutable
reference instead of an immutable reference.</li>
<li>Add <code>LruCache::promote</code> and <code>LruCache::demote</code>
API to manipulate LRU order of the entry directly.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/cf063f6ec292239c716873d53a70094a97e16221"><code>cf063f6</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/156">#156</a>
from jeromefroe/jerome/prepare-0-8-1-release</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/3d69719dfee8930321e8b1d6f463f00e55633825"><code>3d69719</code></a>
Prepare 0.8.1 release</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/6db16540d6d96fd790cd8f6d5afbc811b7db8bd2"><code>6db1654</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/155">#155</a>
from rtzoeller/add-categories</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/f6ada6a79ae313b97927f7e6beaf52cadff19ad2"><code>f6ada6a</code></a>
Add categories to Cargo.toml</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/e2e887e85c339404dcb6e297d023f47294361124"><code>e2e887e</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/154">#154</a>
from jeromefroe/jerome/prepare-0-8-0-release</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/b3883826f93e13ad7b40b4facbec8d660703171c"><code>b388382</code></a>
Prepare 0.8.0 release</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/29561cb6268e0dd795e9f709876e135b6780be02"><code>29561cb</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/152">#152</a>
from matklad/promete-demote</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/ad3adcc3bd14c01d2c674dc08938bd4e43078b9d"><code>ad3adcc</code></a>
Add API to directly manipulate LRU order</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/ff6c80e255b129d37f40c589a31abf40f5384727"><code>ff6c80e</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/151">#151</a>
from Yosi-Hezi/get_mut_or_insert</li>
<li><a
href="https://github.com/jeromefroe/lru-rs/commit/d5230df5dcdd2c11d9d82c7a1661338cf1aa62e8"><code>d5230df</code></a>
Merge pull request <a
href="https://redirect.github.com/jeromefroe/lru-rs/issues/153">#153</a>
from matklad/lifetime-bug</li>
<li>Additional commits viewable in <a
href="https://github.com/jeromefroe/lru-rs/compare/0.7.8...0.8.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=lru&package-manager=cargo&previous-version=0.7.8&new-version=0.8.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Grzegorz Gawryał <[email protected]>
Co-authored-by: Grzegorz Gawryał <[email protected]>
  • Loading branch information
3 people authored Aug 7, 2023
1 parent 3853df0 commit cdb695f
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 313 deletions.
503 changes: 202 additions & 301 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ hex = { version = "0.4" }
hex-literal = { version = "0.3" }
ip_network = { version = "0.4" }
jsonrpsee = { version = "0.16.2" }
libp2p = { version = "0.49.0" }
libp2p = { version = "0.50.1" }
log = { version = "0.4" }
lru = { version = "0.7" }
lru = { version = "0.8" }
parity-scale-codec = { version = "3.0", default-features = false }
parking_lot = { version = "0.12" }
paste = { version = "1.0.11" }
Expand Down
2 changes: 1 addition & 1 deletion finality-aleph/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "finality-aleph"
version = "0.7.0"
version = "0.8.0"
license = "Apache 2.0"
authors.workspace = true
edition.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions finality-aleph/src/data_io/data_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::{
collections::{hash_map::Entry::Occupied, BTreeMap, HashMap, HashSet},
default::Default,
hash::{Hash, Hasher},
num::NonZeroUsize,
sync::Arc,
time::{self, Duration},
};
Expand Down Expand Up @@ -136,7 +137,7 @@ pub struct DataStoreConfig {
pub max_triggers_pending: usize,
pub max_proposals_pending: usize,
pub max_messages_pending: usize,
pub available_proposals_cache_capacity: usize,
pub available_proposals_cache_capacity: NonZeroUsize,
pub periodic_maintenance_interval: Duration,
// Specifies how much time must pass from receiving a given proposal for the first time, till we
// perform a request for either a block or a justification required to let this proposal through.
Expand All @@ -149,7 +150,7 @@ impl Default for DataStoreConfig {
max_triggers_pending: 80_000,
max_proposals_pending: 80_000,
max_messages_pending: 40_000,
available_proposals_cache_capacity: 8000,
available_proposals_cache_capacity: NonZeroUsize::new(8000).unwrap(),
periodic_maintenance_interval: Duration::from_secs(25),
request_block_after: Duration::from_secs(20),
}
Expand Down
5 changes: 3 additions & 2 deletions finality-aleph/src/data_io/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::{
fmt::Debug,
hash::{Hash, Hasher},
num::NonZeroUsize,
};

use parity_scale_codec::{Decode, Encode};
Expand Down Expand Up @@ -52,13 +53,13 @@ pub trait AlephNetworkMessage<B: BlockT>: Clone + Debug {

#[derive(Clone, Debug)]
pub struct ChainInfoCacheConfig {
pub block_cache_capacity: usize,
pub block_cache_capacity: NonZeroUsize,
}

impl Default for ChainInfoCacheConfig {
fn default() -> ChainInfoCacheConfig {
ChainInfoCacheConfig {
block_cache_capacity: 2000,
block_cache_capacity: NonZeroUsize::new(2000).unwrap(),
}
}
}
4 changes: 2 additions & 2 deletions finality-aleph/src/data_io/status_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ where

#[cfg(test)]
mod tests {
use std::sync::Arc;
use std::{num::NonZeroUsize, sync::Arc};

use sp_runtime::traits::Block as BlockT;

Expand Down Expand Up @@ -206,7 +206,7 @@ mod tests {
let client = Arc::new(TestClientBuilder::new().build());

let config = ChainInfoCacheConfig {
block_cache_capacity: 2,
block_cache_capacity: NonZeroUsize::new(2).unwrap(),
};
let cached_chain_info_provider = CachedChainInfoProvider::new(client.clone(), config);

Expand Down
8 changes: 7 additions & 1 deletion finality-aleph/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::{
collections::HashMap,
fmt::Debug,
hash::Hash,
num::NonZeroUsize,
time::{Duration, Instant},
};

Expand Down Expand Up @@ -176,7 +177,12 @@ impl<H: Key> Metrics<H> {
gauges,
starts: keys
.iter()
.map(|k| (*k, LruCache::new(MAX_BLOCKS_PER_CHECKPOINT)))
.map(|k| {
(
*k,
LruCache::new(NonZeroUsize::new(MAX_BLOCKS_PER_CHECKPOINT).unwrap()),
)
})
.collect(),
sync_broadcast_counter: register(
Counter::new("aleph_sync_broadcast", "no help")?,
Expand Down
4 changes: 2 additions & 2 deletions finality-aleph/src/testing/data_store.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{future::Future, sync::Arc, time::Duration};
use std::{future::Future, num::NonZeroUsize, sync::Arc, time::Duration};

use futures::{
channel::{
Expand Down Expand Up @@ -157,7 +157,7 @@ fn prepare_data_store(
max_triggers_pending: 80_000,
max_proposals_pending: 80_000,
max_messages_pending: 40_000,
available_proposals_cache_capacity: 8000,
available_proposals_cache_capacity: NonZeroUsize::new(8000).unwrap(),
periodic_maintenance_interval: Duration::from_millis(20),
request_block_after: Duration::from_millis(30),
};
Expand Down

0 comments on commit cdb695f

Please sign in to comment.