-
Notifications
You must be signed in to change notification settings - Fork 1.6k
refactor: Made DatabaseStorageProof stateful #15829
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?
refactor: Made DatabaseStorageProof stateful #15829
Conversation
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.
I have some suggestions that should simplify how we use these methods, lmk if you have any questions or are stuck with anything
pub trie_cursor_factory: T, | ||
/// The factory for hashed cursors. | ||
hashed_cursor_factory: H, | ||
pub hashed_cursor_factory: H, |
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.
do these need to be pub?
&StorageProof::new( | ||
DatabaseTrieCursorFactory::new(self.tx()), | ||
DatabaseHashedCursorFactory::new(self.tx()), | ||
address, | ||
), | ||
address, | ||
slots, | ||
hashed_storage, |
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.
imo we should implement a method on StorageProof
that is identical to the previous from_tx
implementation, then we should be able to do something like:
StorageProof::from_tx(self.tx()).overlay_storage_multiproof(address, slots, hashed_storage)
29073f2
to
97518b3
Compare
@Rjected , I have updated my code with the requested changes. Here is an explainer:
reth/crates/trie/db/src/proof.rs Lines 119 to 125 in 97518b3
This is the best solution I was able to find, if there was something more obvious possible, my apologies. Would love some feedback. |
@Rjected could you ptal? |
Resolves #15477