ethereum-optimism / op-geth

GNU Lesser General Public License v3.0
255 stars 654 forks source link

core/vm: Allow precompiles to be overriden #242

Closed Inphi closed 4 months ago

Inphi commented 4 months ago

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.