The following is an analysis of MODEXP precompile calls, the dataset was collected by tracing calls to the MODEXP precompile since ~Byzantium Hard Fork until Block 21550926 (January 4th, 2025), the analysis contains the different input sizes used in all MODEXP calls and its frequency, being size 32 the most commonly used base/exponent/mod size, and 512 the maximum observed size (with the exception of a couple of transactions using size 513 for baseLen):
Could this analysis be updated to explicitly define if these are bits or bytes? Even though the max bits/bytes reported seem to be 513 (2 entries in base_len), it is not clear to me if those are bits or bytes. (The 513 would fit in the EIP requirement of < 8192 bits / 1024 bytes, but would be nice to know by the analysis if the current “max” usage is 513 bits or bytes (likely: bytes?))
Can a note be added that the precompile inputs <length_of_BASE> <length_of_EXPONENT> <length_of_MODULUS> are expressed in bytes, not in bits?
EIP reads this:
We introduce an upper bound to the inputs of the precompile, each of the length inputs (length_of_BASE , length_of_EXPONENT and length_of_MODULUS ) MUST be less than or equal to 8192 bits (1024 bytes).
For a quick implementation of this EIP, people are likely going to check if these lengths are less than or equal to 8192. (This should be 1024)
EIP 7883 (the price changes to MODEXP (fun side note, that EIP uses ModExp)) will likely be shipped with this one.
It has a test cases section EIP-7883: ModExp Gas Cost Increase which covers most (all?) test cases from ethereum-tests. Looking at the names it seems that some of those are now invalid. I don’t think this is a problem (they are likely benchmark/stress tests for some specific values?) but it might be handy to add this also in the EIP as note.
This EIP mentions:
While we don’t suggest to rework the pricing function, it may be possible in a future upgrade once the limits are in place.
Yes, just the scope of the EIP was limited to exclude repricing. The repricing EIP can make use of these new limits when considering the pricing formula.