Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate GrowingStore and RevertibleStore #182

Merged
merged 5 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions basecoin/store/src/impls/growing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::types::{Height, Path};
/// If the path is deleted, the stored value is []
/// Note: we should not allow empty vec to store as
/// this would conflict with the deletion representation.
#[deprecated(since = "TBD", note = "InMemoryStore implements deletion in AVL tree.")]
rnbguy marked this conversation as resolved.
Show resolved Hide resolved
#[derive(Clone, Debug)]
pub struct GrowingStore<S> {
store: S,
Expand Down
10 changes: 10 additions & 0 deletions basecoin/store/src/impls/revertible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ use crate::types::{Height, Path};
/// an overwriting `set` doesn't reorganize a Merkle tree - but non-overwriting `set` and `delete`
/// operations may reorganize a Merkle tree - which may change the root hash. However, a Merkle
/// store should have no effect on a failed transaction.
#[deprecated(
since = "TBD",
note = "Using operation log to revert changes does not guarantee deterministic Merkle root hash."
rnbguy marked this conversation as resolved.
Show resolved Hide resolved
)]
#[derive(Clone, Debug)]
pub struct RevertibleStore<S> {
/// backing store
Expand Down Expand Up @@ -95,6 +99,12 @@ where
Ok(())
}

/// Revert all operations in the operation log.
///
/// This method doesn't guarantee the Merkle tree with the exactly previous root hash.
rnbguy marked this conversation as resolved.
Show resolved Hide resolved
/// It should be avoided. Use `InMemoryStore` directly which implements rollback directly.
///
/// GH issue: informalsystems/basecoin-rs#129
#[inline]
fn reset(&mut self) {
// note that we do NOT call the backing store's reset here - this allows users to create
Expand Down
Loading