-
Notifications
You must be signed in to change notification settings - Fork 78
Implement the history overlay mechanism #679
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d076aac
feat(SmtForest): Implement the tree history
iamrecursion d96d1a4
Update the History structure based on feedback
iamrecursion 28b21f8
Add some additional utility methods to `History`
iamrecursion ba96b6d
Changes in response to PR feedback
iamrecursion 0939968
Some additional PR tweaks
iamrecursion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,21 @@ | ||
| //! This module contains the error types and helpers for working with errors from the large SMT | ||
| //! forest. | ||
|
|
||
| use thiserror::Error; | ||
|
|
||
| use crate::merkle::{MerkleError, smt::large_forest::history::error::HistoryError}; | ||
|
|
||
| /// The errors returned by operations on the large SMT forest. | ||
| /// | ||
| /// This type primarily serves to wrap more specific error types from various subsystems into a | ||
| /// generic interface type. | ||
| #[derive(Debug, Error)] | ||
| pub enum LargeSmtForestError { | ||
| #[error(transparent)] | ||
| HistoryError(#[from] HistoryError), | ||
|
|
||
| #[error(transparent)] | ||
| MerkleError(#[from] MerkleError), | ||
| } | ||
|
|
||
| pub mod history {} |
This file contains hidden or 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,23 @@ | ||
| //! The error type and utility types for working with errors from the SMT history construct. | ||
| use thiserror::Error; | ||
|
|
||
| use crate::merkle::smt::large_forest::history::VersionId; | ||
|
|
||
| /// The type of errors returned by the history container. | ||
| #[derive(Debug, Error, PartialEq)] | ||
| pub enum HistoryError { | ||
| /// Raised when a query expects the history to contain at least one entry, but it is empty. | ||
| #[error("The history was empty")] | ||
| HistoryEmpty, | ||
|
|
||
| /// Raised when a version is added to the history and is not newer than the previous. | ||
| #[error("Version {0} is not monotonic with respect to {1}")] | ||
| NonMonotonicVersions(VersionId, VersionId), | ||
|
|
||
| /// Raised when no version exists in the history for an arbitrary query. | ||
| #[error("The specified version is too old to be served by the history")] | ||
| VersionTooOld, | ||
| } | ||
|
|
||
| /// The result type for use within the history container. | ||
| pub type Result<T> = core::result::Result<T, HistoryError>; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.