This is copied over from: paradigmxyz/reth#15536 (comment)
My comment there seems to be wrong: Ok(None) signifies that the precompile does not exist, as seen here:
let Some(precompile) = self.precompiles.get(address) else {
return Ok(None);
};
I'm guessing there are reasons to not make this an Error, if so, it would be good to document the difference between Ok(None) and Err(Error) so that if someone implements it, they do not return an error when the precompile does not exist for example.
For the EthPrecompile structs implementation of run, it seems that unless the Error is fatal, it will return Ok and one needs to check the InstructionResult for OutOfGas or PrecompileError
This is copied over from: paradigmxyz/reth#15536 (comment)
My comment there seems to be wrong:
Ok(None)signifies that the precompile does not exist, as seen here:I'm guessing there are reasons to not make this an Error, if so, it would be good to document the difference between
Ok(None)andErr(Error)so that if someone implements it, they do not return an error when the precompile does not exist for example.For the EthPrecompile structs implementation of
run, it seems that unless the Error is fatal, it will returnOkand one needs to check theInstructionResultforOutOfGasorPrecompileError