py-evm: Contract creation transactions don't specify a salt

What is wrong?

Contract creation transactions don’t specify a salt (see https://github.com/ethereum/py-evm/blob/sharding/evm/vm/forks/sharding/vm_state.py#L60-L63). As a result, the address of the created contract is given by the bytecode only and thus it’s impossible to deploy the same contract twice.

How can it be fixed

Specify the salt somehow. Potential candidates could be

  • the first/last 32 bytes of transaction.code
  • the first/last 32 bytes of transaction.data
  • transaction.to (which is meaningless for contract creation transactions right now)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (17 by maintainers)

Most upvoted comments

EIP232 looks like a cleaner and better approach in the long term but I suppose it’s not going to be as trivial to implement as adding a salt field? What about adding salt field for now(short term) and starts an issue about implementing EIP232?

@pipermerriam @hwwhww @jannikluhn It seems cleaner if we just add salt to transaction format, as suggested by @vbuterin and to conform with suggested transaction format of main chain in this EIP.