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

fix "feat(evm): use RethEvmBuilder inside ConfigureEvm" #9813

Merged
merged 7 commits into from
Jul 30, 2024

Conversation

tcoratger
Copy link
Contributor

Fix #9745

Related #9805

@tcoratger tcoratger marked this pull request as ready for review July 25, 2024 17:46
@tcoratger
Copy link
Contributor Author

@mattsse I think I got the issue, it was in the replacement of

fn evm_with_env<DB: Database>(
        &self,
        db: DB,
        env: EnvWithHandlerCfg,
    ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> {
        let mut evm = self.evm(db);
        evm.modify_spec_id(env.spec_id());
        evm.context.evm.env = env.env;
        evm
    }

I did

fn evm_with_env<DB: Database>(
        &self,
        db: DB,
        env: EnvWithHandlerCfg,
    ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> {
        RethEvmBuilder::new(db, self.default_external_context()).with_env(env.into()).build()
    }

but this is not exactly true as the starting point of the function right now is the result of self.evm() and not a standard EvmBuilder.

For Ethereum block sync it was ok because self.evm() is equivalent to using RethEvmBuilder::new(db, self.default_external_context()).with_env(env.into()).build () but for Optimism there is a .optimism() that comes into play in the construction.

I therefore propose to merge the first modifications of the two other functions evm_with_env_and_inspector and evm_with_inspector. In the meantime I will think about a solution for evm_with_env.

@mattsse mattsse added this pull request to the merge queue Jul 30, 2024
Merged via the queue into paradigmxyz:main with commit 5827b96 Jul 30, 2024
32 checks passed
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.

2 participants