1
votes

My contract creation requires 5633321 gas - more than default block gas limit. I was able to deploy on Ropsten network it few times ago: https://ropsten.etherscan.io/tx/0xe90e8920018f8b633620c731c68b63f3ce11dc19f59ddb49401c9e2c9cd1f8c2.

Now i want to deploy modified version with (probably updated) geth version right from Remix connected via to geth as web3 provider.

When running geth -testnet without mining arguments Remix IDE reports:

creation of ... Contract errored: exceeds block gas limit

I've tried to mine the transaction on myself with following:

$geth -rpc --nousb --ipcdisable --rpcaddr "127.0.0.1" --rpccorsdomain "*" --syncmode "fast" --rpcapi="db,personal,eth,net,web3,admin" --cache=2048 --testnet --targetgaslimit "5800000" --gasprice "0" --mine --verbosity 4

and i'm still getting the same Remix IDE error. Meanwhile in geth log i can see:

DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=1.128698ms DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=585.129µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=585.857µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=586.8µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=572.322µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=556.395µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=586.05µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=591.607µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=593.849µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=558.404µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=559.293µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=725.188µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=698.486µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=593.769µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=705.957µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=886.8µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=993.159µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=612.746µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=594.387µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=551.487µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=643.653µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=583.393µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=588.098µs DEBUG[07-20|12:32:53] VM returned with error err="contract creation code storage out of gas" DEBUG[07-20|12:32:53] Executing EVM call finished runtime=573.148µs DEBUG[07-20|12:32:55] Recalculated downloader QoS values rtt=18.543326462s confidence=0.984 ttl=56.512994931s DEBUG[07-20|12:32:57] Revalidated node b=7 id=38e1eb00a922f0b7 DEBUG[07-20|12:32:59] Transaction pool status report executable=114 queued=0 stales=16 DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=1.029656ms DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=882.256µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=567.244µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=665.415µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=499.283µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=840.601µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=449.378µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=404.487µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=885.109µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=648.022µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=731.928µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=649.778µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=485.086µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=472.941µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=724.858µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=547.733µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=1.340049ms DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=892.869µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=709.442µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=424.299µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=419.544µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=381.663µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=702.104µs DEBUG[07-20|12:32:59] VM returned with error err="evm: execution reverted" DEBUG[07-20|12:32:59] Executing EVM call finished runtime=444.091µs

BTW Remix IDE estimates gas requirement wrong: { "Creation": { "codeDepositCost": "4072000", "executionCost": "65552", "totalCost": "4137552" }, i've tried to deploy it with this value and failed: https://ropsten.etherscan.io/tx/0x092199ab2a8b535aaed5a954ae549ff8dcb78f4985774f6ad2ea6c1143a7c501.

What should i do to deploy my contract on Ropsten network that requires more than default block gas?

PS. geth 1.8.10 synced with --fast, account is unlocked, account has enough ether.

PPS. As far as i understand block gas limit is agreed between miners and can't be set for single personal miner instance. So what i'm trying to do will just not work. But how did it happen that the block where my first contract deploy transaction was mined has almost 9.000.000 gas limit? https://ropsten.etherscan.io/block/3426903

1

1 Answers

1
votes

We've been having issues with --targetgaslimit too. I just removed that flag and suddenly everything works fine. Considering this post is new, I'm glad someone else is encountering this bug as well. I'll create an issue on the go-ethereum repo on Github.