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

core/vm: Allow precompiles to be overriden #242

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Conversation

Inphi
Copy link
Contributor

@Inphi Inphi commented Feb 12, 2024

Add a config option to override precompiles for Optimism execution.

The usecase for this change is to allow expensive precompiles, such as KZG point evaluation, to be replaced with a version that is more suitable for a given runtime.

For example, in the case of the fault proof program, executing the KZG point evaluation in MIPS32 requires over 15 billion steps. We'd like to offload this expensive execution to the op-program host, where it's much cheaper to execute.

This change modifies behavior only when vm.Config.OptimismPrecompileOverrides is set.

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

LGTM. Just the one note if we do want to restrict to only being able to override known precompiles which seems like a sensible restriction.

core/vm/evm.go Outdated Show resolved Hide resolved
Co-authored-by: Adrian Sutton <adrian@oplabs.co>
@Inphi Inphi merged commit b6d0732 into optimism Feb 12, 2024
10 checks passed
@Inphi Inphi deleted the inphi/kzg-oracle branch February 12, 2024 23:38
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.

None yet

2 participants