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

Inverted Provider Access in SparseTrie and necessary refactoring/modifications #14662

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PoulavBhowmick03
Copy link
Contributor

Potentially fixes #14646

  • I am not sure if this was asked to be done or the work required to close this issue. I have inverted the provider access in the SparseTrie and the RevealedSparseTrie and have made the necessary changes by adding a generic and argument for the provider to the functions update_leaf and remove_leaf
  • I have also updated the tests to take in this additional parameter

There is one issue, in crates/trie/trie/src/witness.rs

if let Some(value) = maybe_leaf_value {
storage_trie.update_leaf(storage_nibbles, value).map_err(|err| {
SparseStateTrieErrorKind::SparseStorageTrie(hashed_address, err.into_kind())
})?;
} else {
storage_trie.remove_leaf(&storage_nibbles).map_err(|err| {
SparseStateTrieErrorKind::SparseStorageTrie(hashed_address, err.into_kind())
})?;
}

I need to add another parameter for the new argument passed in these two functions. What should they be?

@PoulavBhowmick03
Copy link
Contributor Author

@Rjected @mattsse Can you PTAL, and let me know if I am on the right tracks, and what should be added to the witness.rs and for any other changes

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.

Invert provider access in SparseTrie
1 participant