0xPolygon / polygon-edge

A Framework for Building Ethereum-compatible Blockchain Networks
https://polygon.technology/solutions/polygon-edge/
Apache License 2.0
1.01k stars 534 forks source link

rootchain deploy returns error #1595

Closed elaz48 closed 1 year ago

elaz48 commented 1 year ago

Rootchain contract deployment failed

Description

I am following the description on https://wiki.polygon.technology/docs/supernets/operate/deploy/supernets-how-to-configure-rootchain (Single-Host Validator Setup) and I can not deploy the rootchain contracts. I have tried it 5 times but always returning an error: failed to deploy rootchain contracts: failed sending CustomSupernetManager contract deploy transaction: {"code":-32000,"message":"replacement transaction underpriced"}

Here is the explorer link: https://mumbai.polygonscan.com/txs?a=0x4f89ad21f95f0d248b452753ce758b83595d0a88

Your environment

Steps to reproduce

I'm following the tutorial step-by-step starting from this link: https://wiki.polygon.technology/docs/supernets/operate/deploy/supernets-spawn-test-chain This is the command giving the error:

./polygon-edge rootchain deploy \
--deployer-key abc123... \
--genesis ./genesis.json \
--json-rpc https://matic-mumbai.chainstacklabs.com \
--stake-token 0xbe0f75f3a6938F30b21F31a4eda959C826205bD5 \
--stake-manager 0x4b384636C4241982ae338ca47ee41AE83a9a7E1C

Expected behavior

elaz48 commented 1 year ago

works when rootchain is localhost, any idea?

Stefan-Ethernal commented 1 year ago

It sounds like a duplicate of https://github.com/0xPolygon/polygon-edge/issues/1551. The problem was that we were using hardcoded values for gas price, instead of estimating it. So when running the Geth instance in dev mode locally, there are no other transactions that would make root chain deployment transactions underpriced (however on the Mumbai network this is not the case).

So I'll mark this issue as completed, and feel free to reopen it if you witness issues even with the fix applied.