-
Couldn't load subscription status.
- Fork 2k
[wip] feat: extend ChainStorage capabilities
#19195
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
base: main
Are you sure you want to change the base?
Conversation
|
Your PR title doesn't follow the Conventional Commit guidelines. Example of valid titles:
Usage:
Breaking Changes Breaking changes are noted by using an exclamation mark. For example:
Help For more information, follow the guidelines here: https://www.conventionalcommits.org/en/v1.0.0/ |
| Types: NodeTypesForProvider<Primitives = Primitives>; | ||
| Types: NodeTypesForProvider<Primitives = N>; | ||
|
|
||
| /// Optionally specifies extra database tables required for node operation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we document here how this is used?
| _provider: &Provider, | ||
| _state: &ExecutionOutcome<N::Receipt>, | ||
| ) -> ProviderResult<()> { | ||
| Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah noop like this is easier than adding some optional logic, so this makes sense
| pub type ReadBodyInput<'a, B> = | ||
| (&'a <B as Block>::Header, Vec<<<B as Block>::Body as BlockBody>::Transaction>); | ||
| /// Hook to revert any [`ChainStorageWriter::write_custom_state`] changes. | ||
| fn remove_custom_state_above( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two traits make a ton of sense and should unblock a lot of functionality
the core limitation then is that implementations must still handle the in memory sections, which I think is fine because we also do this for all of our impls
| sender: Address, | ||
| tx_index: TxNumber, | ||
| ) -> ProviderResult<Option<Self::Transaction>> { | ||
| let database = self.database_provider_ro()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what this currently doesn't do is respect the in memory section
maybe not worth adding this for this example but should be useful for users that use this as a template?
Extends
ChainStoragecapabilities to allow it defining custom tables and adds more hooks for writing state to those tablesIntroduces
custom-indexexample for speeding upeth_transactionBySenderAndNoncewith a custom index