This repository was archived by the owner on Nov 6, 2020. It is now read-only.
Generic state backend#4632
Merged
Merged
Conversation
make state module public
arkpar
reviewed
Feb 25, 2017
| /// | ||
| pub struct State { | ||
| db: StateDB, | ||
| pub struct State<B> { |
Contributor
Author
There was a problem hiding this comment.
More general > less general. This is a common pattern among e.g. structures in std: constrain the generic parameters only when introducing functionality that depends on those constraints.
Collaborator
There was a problem hiding this comment.
I'd agree if there was some generic functionality, but State is pretty much useless without a backend. Attempting to use it with unsupported type will leave you with a bare struct which does not really represent the State abstraction. I think it would be better to explicitly disallow that.
Merged
Closed
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes #4616.
This is intended to allow us to enact state changes on general databases/caches, rather than just the single
StateDB.Also opens the door to executing EVMs over different account storage models, by moving the trie lookups fully into the backend, which may be done in the future.