-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Deprecate "paritydb-experimental" CLI in favour or "paritydb" #10975
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -201,8 +201,10 @@ pub enum Database { | |
| /// ParityDb. <https://github.com/paritytech/parity-db/> | ||
| ParityDb, | ||
| /// Detect whether there is an existing database. Use it, if there is, if not, create new | ||
| /// instance of paritydb | ||
| /// instance of RocksDb | ||
| Auto, | ||
| /// ParityDb. <https://github.com/paritytech/parity-db/> | ||
| ParityDbDeprecated, | ||
| } | ||
|
|
||
| impl std::str::FromStr for Database { | ||
|
|
@@ -212,6 +214,8 @@ impl std::str::FromStr for Database { | |
| if s.eq_ignore_ascii_case("rocksdb") { | ||
| Ok(Self::RocksDb) | ||
| } else if s.eq_ignore_ascii_case("paritydb-experimental") { | ||
| Ok(Self::ParityDbDeprecated) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function gets called multiple times, so can't just print a warning here.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could only log it once using
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't say I like this idea. Introducing global variable and yet another dependency for a trivial thing. |
||
| } else if s.eq_ignore_ascii_case("paritydb") { | ||
| Ok(Self::ParityDb) | ||
| } else if s.eq_ignore_ascii_case("auto") { | ||
| Ok(Self::Auto) | ||
|
|
@@ -224,7 +228,7 @@ impl std::str::FromStr for Database { | |
| impl Database { | ||
| /// Returns all the variants of this enum to be shown in the cli. | ||
| pub fn variants() -> &'static [&'static str] { | ||
| &["rocksdb", "paritydb-experimental", "auto"] | ||
| &["rocksdb", "paritydb", "paritydb-experimental", "auto"] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would just remove paritydb-experimental from the list (not sure if it is working).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not work. Clap produces an error if an unknown variant is used. |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -230,6 +230,13 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized { | |
| Ok(match database { | ||
| Database::RocksDb => DatabaseSource::RocksDb { path: rocksdb_path, cache_size }, | ||
| Database::ParityDb => DatabaseSource::ParityDb { path: paritydb_path }, | ||
| Database::ParityDbDeprecated => { | ||
| eprintln!( | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
| "WARNING: \"paritydb-experimental\" database setting is deprecated and will be removed in future releases. \ | ||
| Please update your setup to use the new value: \"paritydb\"." | ||
| ); | ||
| DatabaseSource::ParityDb { path: paritydb_path } | ||
| }, | ||
| Database::Auto => DatabaseSource::Auto { paritydb_path, rocksdb_path, cache_size }, | ||
| }) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it parity db ?
(that is what I got when testing the polkadot parity-db pr, actually I did observe an artifact of rocksdb but it was not used)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I though "Auto" is now the default CLI setting and it defaults to paritydb. But apparently "RocksDb" is still default.