Golang Native DApp: increase gas limit in simulator

2018-02-21 11:03:35

I am developing Native DApp in Golang and I am trying to use network simulator for testing purposes, but I have a problem increasing gas limit.

Some time ago GenesisGasLimit in go-ethereum/params/protocol_params.go was a variable, so I had no problem setting value I wish. But then it has changed to a constant value of 4712388.

I tried setting TargetGasLimit to a value I need and I assumed that after committing a simple transaction, the simulator would simulate the process of voting for increasing gas limit up to TargetGasLimit and would allow me to commit transactions with higher gas limit afterwards, but, apparently, I was wrong. So the question is - is there a way to increase gas limit in the network simulator other than changing its value in go-ethereum sources.

Here is a snippet I use for starting network simulator

//params.TargetGasLimit = 7900000 // doesn't work

genesisBlock := make(core.GenesisAlloc)

initialBalance := new(big.Int)

fmt.Sscan("1000000000000000000