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 state and storage behind one interface #5659

Merged
merged 5 commits into from
May 12, 2023

Conversation

tanishqjasoria
Copy link
Contributor

Resolves #5329
Replaces #5533

some interface and API changes for integrating verkle trees with nethermind.
Also, bring state access under limited interfaces across the solution.

Changes

  • use WorldState instead of State and Storage provider
  • merge the functions UpdateCode and UpdateCodeHash in StateProvider

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a fix or a feature that would cause existing functionality not to work as expected)
  • Documentation update
  • Code style update (formatting, renaming)
  • Refactoring (no functional or API changes)
  • Build-related changes
  • Other: description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • [] No

Notes on testing

synced a node using snap sync and let it run for a few hours after syncing - everything looked normal

@tanishqjasoria tanishqjasoria requested a review from a team as a code owner May 5, 2023 05:57
@tanishqjasoria
Copy link
Contributor Author

@LukaszRozmej @Scooletz now worldState delegates to internal classes StateProvider PersistentStorageProvider TransientStorageProvider
@asdacap the transient and persistent storage is handled by different classes

@@ -332,7 +332,7 @@ private static async Task RunBenchmarkBlocks()
if (allocation.Code != null)
{
Keccak codeHash = stateProvider.UpdateCode(allocation.Code);
stateProvider.UpdateCodeHash(address, codeHash, specProvider.GenesisSpec);
stateProvider.InsertCode(address, codeHash, specProvider.GenesisSpec);
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the second param the code itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahh, yes - my bad

Copy link
Contributor Author

@tanishqjasoria tanishqjasoria May 10, 2023

Choose a reason for hiding this comment

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

which solution is this a part of? i cant find the file in any solution

Copy link
Contributor

@asdacap asdacap left a comment

Choose a reason for hiding this comment

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

Have you tested on mainnet?

@tanishqjasoria
Copy link
Contributor Author

Have you tested on mainnet?

yes, works fine!

@benaadams benaadams mentioned this pull request May 11, 2023
12 tasks
@LukaszRozmej LukaszRozmej merged commit 5ea0440 into master May 12, 2023
@LukaszRozmej LukaszRozmej deleted the world-state-rebase branch May 12, 2023 08:55
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.

refactor StateProvider and StorageProvider behind one interface IWorldState
3 participants