Skip to content

EVM/Exec: properly exit with a precompile outcome when there's a mod overflow with modexp precompiled contract

Rodi-Can Bozman requested to merge rodi@functori@fix-modexp into master

Context

Like we do for other precompiled contract when there's an issue on the execution we should exit with a proper PrecompileOutcome this wasn't the case and throwing an EthereumError lead to an unwanted rollback which removed the nonce increment of the caller. This MR fixes that.

Manually testing the MR

Some tests were fixed with the evm evaluation assessor, you can check by yourself:

stPreCompiledContracts2_modexpRandomInput_data_index_1_gas_index_1_value_index_0: Failure -> Success
stPreCompiledContracts2_modexpRandomInput_data_index_1_gas_index_0_value_index_0: Failure -> Success

I've also extracted one unit test from the tests above, so that we have non-regression check.

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR

Merge request reports