Skip to content

Commit

Permalink
Merge pull request #2166 from input-output-hk/djo/1484/cache-in-clien…
Browse files Browse the repository at this point in the history
…t-certificate-verification

Experimental: Cache in client certificate verification (lib and wasm)
  • Loading branch information
Alenar authored Dec 19, 2024
2 parents d106a3f + 052de8f commit 6cb9d30
Show file tree
Hide file tree
Showing 30 changed files with 2,133 additions and 578 deletions.
13 changes: 8 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/client-snapshot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "client-snapshot"
description = "Mithril client snapshot example"
version = "0.1.21"
version = "0.1.22"
authors = ["dev@iohk.io", "mithril-dev@iohk.io"]
documentation = "https://mithril.network/doc"
edition = "2021"
Expand Down
10 changes: 10 additions & 0 deletions examples/client-snapshot/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ impl FeedbackReceiver for IndicatifFeedbackReceiver {
progress_bar.inc(1);
}
}
MithrilEvent::CertificateFetchedFromCache {
certificate_chain_validation_id: _,
certificate_hash,
} => {
let certificate_validation_pb = self.certificate_validation_pb.read().await;
if let Some(progress_bar) = certificate_validation_pb.as_ref() {
progress_bar.set_message(format!("Cached '{certificate_hash}'"));
progress_bar.inc(1);
}
}
MithrilEvent::CertificateChainValidated {
certificate_chain_validation_id: _,
} => {
Expand Down
2 changes: 1 addition & 1 deletion examples/client-wasm-nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/client-wasm-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mithril-client-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-client-cli"
version = "0.10.5"
version = "0.10.6"
description = "A Mithril Client"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
10 changes: 10 additions & 0 deletions mithril-client-cli/src/utils/feedback_receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ impl FeedbackReceiver for IndicatifFeedbackReceiver {
progress_bar.inc(1);
}
}
MithrilEvent::CertificateFetchedFromCache {
certificate_chain_validation_id: _,
certificate_hash,
} => {
let certificate_validation_pb = self.certificate_validation_pb.read().await;
if let Some(progress_bar) = certificate_validation_pb.as_ref() {
progress_bar.set_message(format!("Cached '{certificate_hash}'"));
progress_bar.inc(1);
}
}
MithrilEvent::CertificateChainValidated {
certificate_chain_validation_id: _,
} => {
Expand Down
7 changes: 5 additions & 2 deletions mithril-client-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-client-wasm"
version = "0.7.2"
version = "0.7.3"
description = "Mithril client WASM"
authors = { workspace = true }
edition = { workspace = true }
Expand All @@ -13,14 +13,17 @@ categories = ["cryptography"]
crate-type = ["cdylib"]

[dependencies]
anyhow = "1.0.94"
async-trait = "0.1.83"
chrono = { version = "0.4.38", features = ["serde"] }
futures = "0.3.31"
mithril-client = { path = "../mithril-client", features = ["unstable"] }
serde = { version = "1.0.215", features = ["derive"] }
serde-wasm-bindgen = "0.6.5"
serde_json = "1.0.132"
wasm-bindgen = "0.2.99"
wasm-bindgen-futures = "0.4.49"
web-sys = { version = "0.3.76", features = ["BroadcastChannel"] }
web-sys = { version = "0.3.76", features = ["BroadcastChannel", "console", "Storage", "Window"] }

[dev-dependencies]
wasm-bindgen-test = "0.3.49"
Expand Down
2 changes: 1 addition & 1 deletion mithril-client-wasm/ci-test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mithril-client-wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mithril-dev/mithril-client-wasm",
"version": "0.7.2",
"version": "0.7.3",
"description": "Mithril client WASM",
"license": "Apache-2.0",
"collaborators": [
Expand Down
Loading

0 comments on commit 6cb9d30

Please sign in to comment.