bluealloy / revm

Ethereum Virtual Machine written in rust that is fast and simple to use
https://bluealloy.github.io/revm/
MIT License
1.57k stars 511 forks source link

chore: Rename gas_price to gas_limit for precompile args #1593

Closed sergerad closed 1 month ago

sergerad commented 1 month ago

The comments refer to the relevant arguments as gas limit

    /// Stateful precompile that is Arc over [`ContextStatefulPrecompile`] trait.
    /// It takes a reference to input, gas limit and Context.
    ContextStateful(ContextStatefulPrecompileArc<DB>),

but the source names the argument gas_price

pub trait ContextStatefulPrecompile<DB: Database>: Sync + Send {
    fn call(
        &self,
        bytes: &Bytes,
        gas_price: u64,

My understanding is that gas price is not relevant to precompiles in general, just gas limit. In which case the variable name gas_price is incorrect.

Thanks!