besu
besu copied to clipboard
Review ModExp Code Post-Fusaka
There appear to be some redundant conversions in the input processing e.g. clampedToInt(clampedToLong()) in BigIntegerModularExponentiationPrecompiledContract.
The long values are used for gas calculation but maybe we can use ints due to https://eips.ethereum.org/EIPS/eip-7823#analysis This may only be possible post-osaka; maybe also possible for pre-osaka mainnet based on the usage analysis (assuming we don't get some txs with > int values executed in the meantime). Perhaps on other networks we would still need to support longs for the inputs though.
Regardless, we can split these input processing/gas calculation codepaths if it proves to be a worthwhile optimisation.