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

Redefine Revision and View #160

Merged
merged 3 commits into from
Jul 20, 2023
Merged

Redefine Revision and View #160

merged 3 commits into from
Jul 20, 2023

Conversation

rkuris
Copy link
Collaborator

@rkuris rkuris commented Jul 19, 2023

Redefine Revision to only refer to previously commited (historical) point-in-time states/versions. Also clarify that the term View just refers to an interface used on revisions or proposals.

Redefine `Revision` to only refer to previously commited (historical)
point-in-time states/versions. Also clarify that the term View just
refers to an interface used on revisions or proposals.
* `Revision` - A historical point-in-time state/version of the trie. This
represents the entire trie, including all `Key`/`Value`s at that point
in time, and all `Node`s.
* `View` - This is the interface to read from a `Revision` or a `Proposal`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

Question, does the DB itself implement View? Or do you always need to get the latest revision?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DB object does not implement the View interface. Why not? Because that View would not be a constant point-in-time thing -- it would change as commits happen. You would be violating the new definition: a View reading from a Revision must be a historical point-in-time, not something that keeps changing as commits happen, which is what the DB object is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 What methods exist on a View that don't exist on the Db itself?

@rkuris rkuris merged commit c2111b8 into main Jul 20, 2023
@rkuris rkuris deleted the rkuris/redefine_revision_and_view branch July 20, 2023 16:12
@rkuris
Copy link
Collaborator Author

rkuris commented Jul 23, 2023 via email

rkuris added a commit that referenced this pull request Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants