Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

estimateGas returns "contract address collision" error #870

Closed
yihuang opened this issue Jan 4, 2022 · 0 comments · Fixed by #871
Closed

estimateGas returns "contract address collision" error #870

yihuang opened this issue Jan 4, 2022 · 0 comments · Fixed by #871

Comments

@yihuang
Copy link
Contributor

yihuang commented Jan 4, 2022

System info: ethermint main

Steps to reproduce:

$ seth send --create `jq -r '.bytecode' integration_tests/contracts/artifacts/contracts/TestMessageCall.sol/TestMessageCall.json` --gas 212958
...success deployed
$ seth estimate --create `jq -r '.bytecode' integration_tests/contracts/artifacts/contracts/TestMessageCall.sol/TestMessageCall.json` "0x"
seth-rpc: error:   code       -32000
seth-rpc: error:   message    rpc error: code = Unknown desc = rpc error: code = Internal desc = contract address collision: unknown request

Expected behavior: estimateGas should work in such case.

Actual behavior: [What actually happened]

Additional info:

In this PR: #851, we changed the state transition logic to use tx.nonce, but with estimateGas, the nonce in request could be zero, which cause "contract address collision" in evm.

yihuang added a commit to yihuang/ethermint that referenced this issue Jan 4, 2022
fedekunze pushed a commit that referenced this issue Jan 4, 2022
* fix: set correct nonce in EthCall/EstimateGas

Closes: #870

* Update CHANGELOG.md

* unit test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant