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

(refactor) Use BundleBuilder instead of hashmaps #8264

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

Conversation

quentinv72
Copy link
Contributor

Closes #4614

  • Update insert_state in crates/node-core/src/init.rs to use BundleBuilder
  • Update unwind_or_peek_state in crates/storage/provider/src/providers/database/provider.rs to use BundleBuilder
  • Remove BundleStateInit, AccountRevertInit, and RevertInit.

.push((old_storage.key.into(), old_storage.value));

bundle_builder = bundle_builder
.state_storage(address, state_storage.entry(address).or_default().clone());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we could probably avoid this clone if we had access to a mutable reference of state_storage on the BundleBuilder

Copy link
Member

Choose a reason for hiding this comment

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

I don't mind, wdyt @joshieDo ?

bundle_builder = bundle_builder.revert_storage(
block_number,
address,
revert_storage.entry(block_and_address).or_default().clone(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same idea as above to avoid clone.

@quentinv72 quentinv72 marked this pull request as ready for review May 14, 2024 19:53
@emhane emhane added D-good-first-issue Nice and easy! A great choice to get started C-debt A section of code is hard to understand or change A-db Related to the database labels May 16, 2024
@quentinv72 quentinv72 requested a review from emhane May 21, 2024 15:06
Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

lgtm, pending @rakita

@mattsse mattsse self-assigned this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database C-debt A section of code is hard to understand or change D-good-first-issue Nice and easy! A great choice to get started
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate BundleBuilder
3 participants