Skip to content

EVM/Exec: Nonce of new address should be incremented before the execution of the init code

Context

According the EIP-161 and some result in the test suite, we already increment the nonce of the contract but after the execution of the init code. So when a contract create another contract in its init code instead of creating the contract with a nonce at 1 the contract is created with a nonce at 0 which is not the expected behavior by the test suite.

Manually testing the MR

Here is the diff after the fix

stExtCodeHash_extCodeHashSelfInInit_data_index_0_gas_index_0_value_index_0: Failure -> Success
stExtCodeHash_codeCopyZero_data_index_0_gas_index_0_value_index_0: Failure -> Success
stInitCodeTest_CallRecursiveContract_data_index_0_gas_index_0_value_index_0: Failure -> Success
stCreateTest_CREATE_EContractCreateNEContractInInit_Tr_data_index_0_gas_index_0_value_index_0: Failure -> Success
stSolidityTest_RecursiveCreateContractsCreate4Contracts_data_index_0_gas_index_0_value_index_0: Failure -> Success
stCreateTest_CreateOOGFromEOARefunds_data_index_18_gas_index_0_value_index_0: Failure -> Success
stCreateTest_CreateOOGFromCallRefunds_data_index_18_gas_index_0_value_index_0: Failure -> Success
stCreateTest_CREATE_empty000CreateinInitCode_Transaction_data_index_0_gas_index_0_value_index_0: Failure -> Success
stCreateTest_CREATE_EContractCreateNEContractInInitOOG_Tr_data_index_0_gas_index_0_value_index_0: Failure -> Success
stDelegatecallTestHomestead_delegatecodeDynamicCode_data_index_0_gas_index_0_value_index_0: Failure -> Success
stCreate2_Create2OOGFromCallRefunds_data_index_18_gas_index_0_value_index_0: Failure -> Success
stHomesteadSpecific_createContractViaContractOOGInitCode_data_index_0_gas_index_0_value_index_0: Failure -> Success
stEIP158Specific_vitalikTransactionTest_data_index_0_gas_index_0_value_index_0: Failure -> Success
stInitCodeTest_CallContractToCreateContractWhichWouldCreateContractInInitCode_data_index_0_gas_index_0_value_index_0: Failure -> Success

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
Edited by Arnaud Bihan

Merge request reports