Skip to content

EVM/Exec: use address from context in execute_call for transfer

Antoine Lanco requested to merge antoine@functori@add-prevrando-eval into master

Context

Currently the function block_randomness in the handler return None. But some test use the opcode 44 witch directly use this function.

I add the random number set by the test in the environment and i return it when the function block_randomness is call.

And

In the function execute_call the transfer is executed from the address passed as an argument but this address is the address given to all of the CALL opcode.

But in the case of CALLCODE the "to" address is not the address to send the balance but only the address to get the code. More generally the SputnikVm gives the correct address in the context given in the arguments.

Manually testing the MR

stRandom2_randomStatetest466_data_index_0_gas_index_0_value_index_0: Failure -> Success
stRandom2_randomStatetest577_data_index_0_gas_index_0_value_index_0: Failure -> Success
stRandom2_randomStatetest627_data_index_0_gas_index_0_value_index_0: Failure -> Success
stRandom_randomStatetest100_data_index_0_gas_index_0_value_index_0: Failure -> Success
stRandom_randomStatetest26_data_index_0_gas_index_0_value_index_0: Failure -> Success
stRandom_randomStatetest138_data_index_0_gas_index_0_value_index_0: Failure -> Success
stRandom_randomStatetest246_data_index_0_gas_index_0_value_index_0: Failure -> Success
stRandom_randomStatetest367_data_index_0_gas_index_0_value_index_0: Failure -> Success
stRandom_randomStatetest153_data_index_0_gas_index_0_value_index_0: Failure -> Success
stRandom_randomStatetest303_data_index_0_gas_index_0_value_index_0: Failure -> Success
stRandom_randomStatetest139_data_index_0_gas_index_0_value_index_0: Failure -> Success
stStaticFlagEnabled_CallcodeToPrecompileFromCalledContract_data_index_0_gas_index_0_value_index_0: Failure -> Success
stStaticFlagEnabled_CallcodeToPrecompileFromTransaction_data_index_0_gas_index_0_value_index_0: Failure -> Success
stStaticCall_static_CallSha256_1_nonzeroValue_data_index_0_gas_index_0_value_index_0: Failure -> Success
stStaticCall_static_callBasic_data_index_3_gas_index_0_value_index_0: Failure -> Success
vmTests_blockInfo_data_index_1_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 Antoine Lanco

Merge request reports