Skip to content

Consider documenting Ok(None) and Err case for PrecompileProvider::run #2393

Description

@kevaundray

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions