-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Remove the --unsafe-pruning
CLI-argument (step 1)
#10995
Remove the --unsafe-pruning
CLI-argument (step 1)
#10995
Conversation
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.
LGTM
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.
Besides the one annoying rustdoc lint it looks fine. The issue #8103 stays open until step 2, I guess.
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.
This doesn't include the required changes regarding continue working as archive node for validators, but new validator nodes should start as pruned node. So, that we don't change any behavior. (The same applies, if you already used unsafe pruning you just continue working as pruned node)
Read the original issue 😊
8bbb0fa
to
6435c39
Compare
The PR summary:
// client/state-db/src/lib.rs: StateDb::open(...)
let (should_update_meta, selected_mode) = match (should_init, stored_mode, requested_mode) ... |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
b3a885a
to
443c10f
Compare
…-make-metadb-readonly-again make MetaDb read-only again!
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.
Ty!
Looks good besides some last nitpicks.
client/service/src/builder.rs
Outdated
if client.requires_full_sync() && | ||
!matches!(config.network.sync_mode, sc_network::config::SyncMode::Full) | ||
{ | ||
return Err("The backend settings require the full-sync mode".into()) |
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.
if client.requires_full_sync() && | |
!matches!(config.network.sync_mode, sc_network::config::SyncMode::Full) | |
{ | |
return Err("The backend settings require the full-sync mode".into()) | |
if client.requires_full_sync() { | |
match config.network.sync_mode { | |
SyncMode::Fast { .. } => return Err("Fast sync doesn't work for archive nodes".into()), | |
SyncMode::Warp => return Err("Warp sync doesn't work for archive nodes".into()), | |
SyncMode::Full => {}, | |
}; |
I think these error messages are little bit more clear.
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.
Those wordings are definitely more clear, but they just happen to tell the truth with the current implementation of requires_full_sync(&self) -> bool
.
Perhaps the "question" to the client should be formulated as is_archive_node(&self) -> bool
in that case...
(I couldn't expose the exact PruningMode
via any of the sc-client-api
interfaces because I didn't see it fit to add another dependency to that crate: either sc-state-db
or sc-client-db
).
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.
Those wordings are definitely more clear, but they just happen to tell the truth with the current implementation of
requires_full_sync(&self) -> bool
.Perhaps the "question" to the client should be formulated as
is_archive_node(&self) -> bool
in that case...
Yes that is being correct. I mean we could change the error message to not contain for archive nodes
and replace that with something like "when the backed requires full sync mode".
Or we expose the pruning mode to make it work like before.
008e97b
to
df30449
Compare
c402bfb
to
8425aac
Compare
8425aac
to
8e0bc33
Compare
bot merge |
* Add BlockBackend::requires_full_sync() implementation * do not specify --pruning explicitly * update lockfile for {"substrate"} * Please re-run the CI * Please re-run the CI Co-authored-by: Roman Gafiyatullin <[email protected]> Co-authored-by: parity-processbot <>
* Substrate API change: paritytech/substrate#8103 * fix fallout of paritytech/polkadot#5454 * update lockfile for {"polkadot"} Co-authored-by: Bernhard Schuster <[email protected]> Co-authored-by: parity-processbot <>
* sc-client-db: utils::open_database(...) — return OpenDbError so that the caller could tell the `OpenDbError::DoesNotExist` clearly * sc-client-db: utils::open_database(..) — accept the `create: bool` argument * sc-client-db: pruning — optional argument in the DatabaseSettings * sc-state-db: Split `Error<E>` into separate `Error<E>` and `StateDbError` * StateDb::open: choose the pruning-mode depending on the requested and stored values * sc-state-db: test for different combinations of stored and requested pruning-modes * CLI-argument: mark the unsafe-pruning as deprecated * Fix tests * tests: do not specify --pruning when running the substrate over the existing storage * fix types for benches * cargo fmt * Check whether the pruning-mode and sync-mode are compatible * cargo fmt * parity-db: 0.3.11 -> 0.3.12 * sc-state-db: MetaDb::set_meta — a better doc-test * cargo fmt * make MetaDb read-only again! * Remove the stray newline (and run the CI once again please) * Last nitpicks * A more comprehensive error message
* sc-client-db: utils::open_database(...) — return OpenDbError so that the caller could tell the `OpenDbError::DoesNotExist` clearly * sc-client-db: utils::open_database(..) — accept the `create: bool` argument * sc-client-db: pruning — optional argument in the DatabaseSettings * sc-state-db: Split `Error<E>` into separate `Error<E>` and `StateDbError` * StateDb::open: choose the pruning-mode depending on the requested and stored values * sc-state-db: test for different combinations of stored and requested pruning-modes * CLI-argument: mark the unsafe-pruning as deprecated * Fix tests * tests: do not specify --pruning when running the substrate over the existing storage * fix types for benches * cargo fmt * Check whether the pruning-mode and sync-mode are compatible * cargo fmt * parity-db: 0.3.11 -> 0.3.12 * sc-state-db: MetaDb::set_meta — a better doc-test * cargo fmt * make MetaDb read-only again! * Remove the stray newline (and run the CI once again please) * Last nitpicks * A more comprehensive error message
* Substrate API change: paritytech/substrate#8103 * fix fallout of paritytech/polkadot#5454 * update lockfile for {"polkadot"} Co-authored-by: Bernhard Schuster <[email protected]> Co-authored-by: parity-processbot <>
* sc-client-db: utils::open_database(...) — return OpenDbError so that the caller could tell the `OpenDbError::DoesNotExist` clearly * sc-client-db: utils::open_database(..) — accept the `create: bool` argument * sc-client-db: pruning — optional argument in the DatabaseSettings * sc-state-db: Split `Error<E>` into separate `Error<E>` and `StateDbError` * StateDb::open: choose the pruning-mode depending on the requested and stored values * sc-state-db: test for different combinations of stored and requested pruning-modes * CLI-argument: mark the unsafe-pruning as deprecated * Fix tests * tests: do not specify --pruning when running the substrate over the existing storage * fix types for benches * cargo fmt * Check whether the pruning-mode and sync-mode are compatible * cargo fmt * parity-db: 0.3.11 -> 0.3.12 * sc-state-db: MetaDb::set_meta — a better doc-test * cargo fmt * make MetaDb read-only again! * Remove the stray newline (and run the CI once again please) * Last nitpicks * A more comprehensive error message
This PR addresses the #8103.
It does not remove CLI-argument completely in order not to break the existing scripts that may use this argument.
Instead it emits a warning when the argument is used. Other than that the argument will take no effect on the execution.
NB: It will be necessary to remove any notion of
unsafe-pruning
in further releases.cumulus companion: paritytech/cumulus#1162
polkadot companion: paritytech/polkadot#5446