-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block gaslimit target decays to 3141592 with custom genesis gasLimit #2185
Comments
The gas limit specified in the genesis block is the limit of the genesis block itself, not the chain. You cannot influence the chain's target gas limit from the outside using Geth. You could always build your own version of Geth that has a modified parameter set to target a different block limit, but I don't think we aim to support such a use case any time soon via CLI parameters. |
That makes sense now. I did not think there was such a thing as a chain gas limit separate from the genesis block. Thanks! |
@karalabe where in the source code I can change the gasLimit? You can point me to that file? |
@pnarayanprusty were you able to change the gasLimit of the chain? |
Just set your target gas limit in your miner to whatever you want |
I am running tests on a private network using the example genesis block linked at the go-ethereum wiki page Private network, with the addition of a
1
ether allocation for address0xffffffffffffffffffffffffffffffffffffffff
.Note I have left the
gasLimit
0x8000000 (134217728
) unchanged.I am launching a single instance of geth
1.3.3
as follows:I observed that the block
gasLimit
decays toward the frontier gas target3141592
:Updating the genesis block with a
gasLimit
of 0x2fefe2 (3141602
), the gasLimit reaches3141592
in the next block and remains there:But this is not expected behaviour.
geth
should respect thegasLimit
that is set in the imported genesis blockdeadbeef.json
.I traced the issue to
worker.commitNewWork()
, which makes a call tocore.CalcGasLimit(parent)
to determine the gaslimit for the next block. It seems likecore.CalcGasLimit()
referencesparams.GenesisGasLimit
, but that variable is not updated from the imported genesis file and so remains at thegeth
default of3141592
. As a result the calculated gas target is adjusted downwards from theparent
block gas limit towards3141592
.The text was updated successfully, but these errors were encountered: