alloy-rs / evm

EVM abstraction layer

Repository from Github https://github.comalloy-rs/evmRepository from Github https://github.comalloy-rs/evm

[Bug] Does it need to handle the precompile contract revert error

will-2012 opened this issue · comments

What version of Alloy are you on?

No response

Describe the bug

let precompile_result = precompile.call(PrecompileInput {
data: input_bytes,
gas: gas_limit,
caller: inputs.caller_address,
value: inputs.call_value,
internals: EvmInternals::new(journal, &context.block),
});
match precompile_result {
Ok(output) => {
let underflow = result.gas.record_cost(output.gas_used);
assert!(underflow, "Gas underflow is not possible");
result.result = InstructionResult::Return;
result.output = output.bytes;
}
Err(PrecompileError::Fatal(e)) => return Err(e),
Err(e) => {
result.result = if e.is_oog() {
InstructionResult::PrecompileOOG
} else {
InstructionResult::PrecompileError
};
}
.