-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Disable pruner for archive mode, add 'prune-discarded' mode
- Loading branch information
Showing
19 changed files
with
159 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Copyright Soramitsu Co., Ltd. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "storage/trie_pruner/trie_pruner.hpp" | ||
|
||
namespace kagome::storage::trie_pruner { | ||
|
||
/** | ||
* IdleTriePruner does nothing, so it can be used to disabled pruning | ||
*/ | ||
class IdleTriePruner : public storage::trie_pruner::TriePruner { | ||
public: | ||
outcome::result<void> addNewState( | ||
const storage::trie::RootHash &state_root, | ||
storage::trie::StateVersion version) override { | ||
return outcome::success(); | ||
} | ||
|
||
outcome::result<void> addNewState( | ||
const storage::trie::PolkadotTrie &new_trie, | ||
storage::trie::StateVersion version) override { | ||
return outcome::success(); | ||
} | ||
|
||
outcome::result<void> pruneFinalized( | ||
const primitives::BlockHeader &state) override { | ||
return outcome::success(); | ||
} | ||
|
||
outcome::result<void> pruneDiscarded( | ||
const primitives::BlockHeader &state) override { | ||
return outcome::success(); | ||
} | ||
|
||
outcome::result<void> recoverState( | ||
const blockchain::BlockTree &block_tree) override { | ||
return outcome::success(); | ||
} | ||
|
||
std::optional<primitives::BlockInfo> getLastPrunedBlock() const override { | ||
return std::nullopt; | ||
} | ||
|
||
std::optional<uint32_t> getPruningDepth() const override { | ||
return std::nullopt; | ||
} | ||
}; | ||
} // namespace kagome::storage::trie_pruner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.