4

Assuming the scenario where a fork occurs shortly after I have sent a transaction out, and it gets mined in my side of the fork, could it also be mined in the other side of the fork? In other words, if we had a fork, is it reasonable to assume that both forks would process the same transaction?

If it was a contract creation transaction, I understand that each of the two instances of that creation would yield a different contract address. However, with a transaction that runs a contract method to alter state, both forks would process them the same way.

3

Yes, the same contract can be mined on both sides of the fork.

I don't think it's correct that each instance of the contract creation would yield a different contract address. Contract addresses are assigned deterministically based on the address creating them and a per-account nonce, so the same transaction, received on both forks in the same order, would yield the same contract address.

Although your client wouldn't normally do this, it should also be theoretically possible to send transactions with different code but the same nonce to different nodes such that, were they subsequently to mine the transactions on different forks, the two forks would have contracts with the same address, but each version would have different code...

  • If the address is deterministic, why would the web3 libs not return the address when you create a contract? There is no reason to wait until they are mined other than the possibility that they won't be mined? As for the simultaneous issue of contract code to different nodes, that is certainly interesting. As an aside - many of the methods for monitoring transaction confirmation rely on checking the transaction hash is valid and included in the chain. Assuming a fork occurs but the transaction is mined in both branches, the hash would be valid on both then... – bozzle Jul 15 '16 at 3:33
  • web3.js could indeed return the contract address without waiting for it to be mined, as proposed here: github.com/ethereum/EIPs/issues/68#issuecomment-185521695 – Edmund Edgar Jul 15 '16 at 4:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.