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

VM: SimpleStateManager as Default State Manager #3573

Closed
holgerd77 opened this issue Aug 9, 2024 · 2 comments
Closed

VM: SimpleStateManager as Default State Manager #3573

holgerd77 opened this issue Aug 9, 2024 · 2 comments

Comments

@holgerd77
Copy link
Member

I think we do not loose anything if we also switch on the VM to use the SimpleStateManager as the default one, since in this case the VM is not meant to operate on some state-containing state manager anyhow. This will have a substantial effect on the bundle size for the default VM initalization.

This likely needs some small adjustments like going from throwing for the get/has/setStateRoot methods for the simple state manager to fake ones like (I think?) being done for the RPC state manager, also a bit related is #3546 in this context.

@gabrocheleau
Copy link
Contributor

I think we do not loose anything if we also switch on the VM to use the SimpleStateManager as the default one, since in this case the VM is not meant to operate on some state-containing state manager anyhow. This will have a substantial effect on the bundle size for the default VM initalization.

This likely needs some small adjustments like going from throwing for the get/has/setStateRoot methods for the simple state manager to fake ones like (I think?) being done for the RPC state manager, also a bit related is #3546 in this context.

I have done a simple, naive attempt at this task (switch the VM DefaultStateManager's instantiation to SimpleStateManager). This works for some cases, but not for others.

The main blocker I have run into is that a lot of tests rely on the presence of a trie or (or at least a state root), e.g. runBlock, index.spec.ts, some EIPs, etc.

Of course it is expected that the SimpleStateManager would be limited. A couple of options/improvements that come to mind:

  • Adjust the concerned tests so that they use a manually instantiated DefaultStateManager instead of the default SimpleStateManager
  • Adjust the SimpleStateManager so it has some capability to handle stateRoot. I've done that alrady to some extent by copying the behavior we have in the RpcStateManager, but I don't see how much more could be done
  • We could also add some checks in the VM, for example validating that a proper stateManager (e.g. not the SimpleStateManager) has been provided to perform some actions like runBlock with validation?

@holgerd77
Copy link
Member Author

This is a dead end, see my answer on the PR, will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants