From 57a957725b022aa281a56dfb28d681bca5bd64f9 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Wed, 15 Sep 2021 17:16:38 +0200 Subject: [PATCH 1/3] light-client: Do not enable `lightstore-sled` by default --- light-client/Cargo.toml | 2 +- light-client/examples/light_client.rs | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/light-client/Cargo.toml b/light-client/Cargo.toml index 6c5c6b551..3142eb571 100644 --- a/light-client/Cargo.toml +++ b/light-client/Cargo.toml @@ -28,7 +28,7 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [features] -default = ["std", "eyre_tracer", "rpc-client", "lightstore-sled"] +default = ["std", "eyre_tracer", "rpc-client"] eyre_tracer = ["flex-error/eyre_tracer"] rpc-client = ["tokio", "tendermint-rpc/http-client"] secp256k1 = ["tendermint/secp256k1", "tendermint-rpc/secp256k1"] diff --git a/light-client/examples/light_client.rs b/light-client/examples/light_client.rs index f2c1a3824..6b6320ade 100644 --- a/light-client/examples/light_client.rs +++ b/light-client/examples/light_client.rs @@ -1,7 +1,4 @@ -use std::{ - path::{Path, PathBuf}, - time::Duration, -}; +use std::{path::PathBuf, time::Duration}; use gumdrop::Options; @@ -12,7 +9,7 @@ use tendermint_light_client::supervisor::{Handle as _, Instance}; use tendermint_light_client::{ builder::{LightClientBuilder, SupervisorBuilder}, light_client, - store::sled::SledStore, + store::memory::MemoryStore, types::{Height, PeerId, TrustThreshold}, }; @@ -81,10 +78,9 @@ fn main() { fn make_instance( peer_id: PeerId, addr: tendermint_rpc::Url, - db_path: impl AsRef, opts: &SyncOpts, ) -> Result> { - let light_store = SledStore::open(db_path)?; + let light_store = MemoryStore::new(); let rpc_client = rpc::HttpClient::new(addr).unwrap(); let options = light_client::Options { trust_threshold: TrustThreshold::default(), @@ -111,11 +107,8 @@ fn sync_cmd(opts: SyncOpts) -> Result<(), Box> { let primary_addr = opts.address.clone(); let witness_addr = opts.address.clone(); - let primary_path = opts.db_path.join(primary.to_string()); - let witness_path = opts.db_path.join(witness.to_string()); - - let primary_instance = make_instance(primary, primary_addr.clone(), primary_path, &opts)?; - let witness_instance = make_instance(witness, witness_addr.clone(), witness_path, &opts)?; + let primary_instance = make_instance(primary, primary_addr.clone(), &opts)?; + let witness_instance = make_instance(witness, witness_addr.clone(), &opts)?; let supervisor = SupervisorBuilder::new() .primary(primary, primary_addr, primary_instance) From 3163298fd66e408803961c6848cc35ef522fcae4 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 16 Sep 2021 15:34:39 +0200 Subject: [PATCH 2/3] Add .changelog entry --- .../unreleased/breaking-changes/disable-sled-lightstore.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changelog/unreleased/breaking-changes/disable-sled-lightstore.md diff --git a/.changelog/unreleased/breaking-changes/disable-sled-lightstore.md b/.changelog/unreleased/breaking-changes/disable-sled-lightstore.md new file mode 100644 index 000000000..adc7928cd --- /dev/null +++ b/.changelog/unreleased/breaking-changes/disable-sled-lightstore.md @@ -0,0 +1 @@ +- `[light-client]` Disable the `lightstore-sled` feature by default ([#976](https://github.com/informalsystems/tendermint-rs/issues/976)) From 7a6047bcdc22b49c779530093e9beb1c21aefaf0 Mon Sep 17 00:00:00 2001 From: Thane Thomson Date: Thu, 16 Sep 2021 11:37:13 -0400 Subject: [PATCH 3/3] Update .changelog/unreleased/breaking-changes/disable-sled-lightstore.md --- .../unreleased/breaking-changes/disable-sled-lightstore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/unreleased/breaking-changes/disable-sled-lightstore.md b/.changelog/unreleased/breaking-changes/disable-sled-lightstore.md index adc7928cd..85e420744 100644 --- a/.changelog/unreleased/breaking-changes/disable-sled-lightstore.md +++ b/.changelog/unreleased/breaking-changes/disable-sled-lightstore.md @@ -1 +1 @@ -- `[light-client]` Disable the `lightstore-sled` feature by default ([#976](https://github.com/informalsystems/tendermint-rs/issues/976)) +- `[tendermint-light-client]` Disable the `lightstore-sled` feature by default ([#976](https://github.com/informalsystems/tendermint-rs/issues/976))