-
Notifications
You must be signed in to change notification settings - Fork 44
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
Derive Clone for EvmEnv #204
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.
With #91 we've introduced the ability to execute multiple calls using the same EvmEnv
, so this feature would only be useful in a case where multiple independent Steel proofs (but still referencing the same block) are to be generated within the same host file.
I am a bit reluctant to make the env clonable, as this would also clone the underlying DB with all its current entries. This could lead to errors or misunderstandings as to whether the cloned envs have the same state or not.
If this is really a realistic use case, are there perhaps simple alternatives? Like maybe introducing an EnvBuilder?
You make some very good points. I will think some more and get back to you. |
This is exactly the situation I'm in. Basically, I need to do a bunch of separate Steel proofs, which I then roll-up into one proof. Right now I'm doing something like this:
This saves me from needing to pass the RPC url, block number, chain_spec. A builder would be just as good for this purpose, and also (as you point out) would be less error prone. I'll close this PR and maybe we can make the builder happen this week |
Add the `EvmEnvBuilder` to simplify the creation of an `EvmEnv` on the host. See #204 for more context. --------- Co-authored-by: Victor Graf <[email protected]>
Add the `EvmEnvBuilder` to simplify the creation of an `EvmEnv` on the host. See #204 for more context. --------- Co-authored-by: Victor Graf <[email protected]>
Add the `EvmEnvBuilder` to simplify the creation of an `EvmEnv` on the host. See #204 for more context. --------- Co-authored-by: Victor Graf <[email protected]>
Why?
Imagine a situation where the host wants to generate multiple Steel proofs, all using the same RPC provider and block number. In this case, one might start by setting up an EthEvmEnv:
Later, each time we want to use Steel, we work from a fresh clone of
env
.In this way, we can avoid passing the RPC and block number around (less verbose and maybe less error prone)