2

我的合约创建需要5633321 gas - 超过默认的块 gas 限制。几次前我能够在Ropsten网络上部署它: https ://ropsten.etherscan.io/tx/0xe90e8920018f8b633620c731c68b63f3ce11dc19f59ddb49401c9e2c9cd1f8c2 。

现在我想部署修改后的版本(可能是更新的)geth 版本,从 Remix 连接到 geth 作为 web3 提供程序。

在没有挖掘参数的情况下运行时geth -testnet,Remix IDE 报告:

创建 ... 合约错误:超过区块气体限制

我试图通过以下方式对自己进行交易:

$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

而且我仍然遇到相同的 Remix IDE 错误。同时在geth日志中我可以看到:

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 估计 gas 需求错误: { "Creation": { "codeDepositCost": "4072000", "executionCost": "65552", "totalCost": "4137552" }, 我尝试使用此值部署它并失败: https ://ropsten.etherscan.io/tx/0x092199ab2a8b535aaed5a954ae549ff8dcb78f4985774f6ad2ea6c1143a7c501 。

我应该怎么做才能在 Ropsten 网络上部署我的合约,该网络需要的不仅仅是默认区块气体?

PS。geth1.8.10与 同步--fast,帐户已解锁,帐户有足够的以太币。

聚苯乙烯。据我了解,区块气体限制是矿工之间商定的,不能为单个个人矿工实例设置。所以我想做的就是行不通。但是,我的第一个合约部署交易被挖掘的区块有将近 9.000.000 的气体限制是怎么发生的呢?https://ropsten.etherscan.io/block/3426903

4

1 回答 1

1

我们也一直有问题--targetgaslimit。我刚刚删除了那个标志,突然一切正常。考虑到这篇文章是新的,我很高兴其他人也遇到了这个错误。我将在 Github 上的 go-ethereum repo 上创建一个问题。

于 2018-07-29T18:31:06.623 回答