Connect gasLimit from Config to CommonRef (#2946)
This commit is contained in:
parent
0b704040e3
commit
f74813520a
|
@ -476,7 +476,12 @@ func `extraData=`*(com: CommonRef, val: string) =
|
|||
com.extraData = val
|
||||
|
||||
func `gasLimit=`*(com: CommonRef, val: uint64) =
|
||||
com.gasLimit = val
|
||||
if val < GAS_LIMIT_MINIMUM:
|
||||
com.gasLimit = GAS_LIMIT_MINIMUM
|
||||
elif val > GAS_LIMIT_MAXIMUM:
|
||||
com.gasLimit = GAS_LIMIT_MAXIMUM
|
||||
else:
|
||||
com.gasLimit = val
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# End
|
||||
|
|
|
@ -468,7 +468,6 @@ proc assembleBlock*(
|
|||
## tuning parameters. The following block header fields are left
|
||||
## uninitialised:
|
||||
##
|
||||
## * *extraData*: Blob
|
||||
## * *mixHash*: Hash32
|
||||
## * *nonce*: BlockNonce
|
||||
##
|
||||
|
|
|
@ -221,14 +221,14 @@ proc run(nimbus: NimbusNode, conf: NimbusConf) =
|
|||
try:
|
||||
if conf.numThreads < 0:
|
||||
fatal "The number of threads --num-threads cannot be negative."
|
||||
quit 1
|
||||
quit QuitFailure
|
||||
elif conf.numThreads == 0:
|
||||
Taskpool.new(numThreads = min(countProcessors(), 16))
|
||||
else:
|
||||
Taskpool.new(numThreads = conf.numThreads)
|
||||
except CatchableError as e:
|
||||
fatal "Cannot start taskpool", err = e.msg
|
||||
quit 1
|
||||
quit QuitFailure
|
||||
|
||||
info "Threadpool started", numThreads = taskpool.numThreads
|
||||
|
||||
|
@ -244,7 +244,15 @@ proc run(nimbus: NimbusNode, conf: NimbusConf) =
|
|||
extraData=conf.extraData,
|
||||
len=conf.extraData.len
|
||||
|
||||
if conf.gasLimit > GAS_LIMIT_MAXIMUM or
|
||||
conf.gasLimit < GAS_LIMIT_MINIMUM:
|
||||
warn "GasLimit not in expected range, truncate",
|
||||
min=GAS_LIMIT_MINIMUM,
|
||||
max=GAS_LIMIT_MAXIMUM,
|
||||
get=conf.gasLimit
|
||||
|
||||
com.extraData = conf.extraData
|
||||
com.gasLimit = conf.gasLimit
|
||||
|
||||
defer:
|
||||
com.db.finish()
|
||||
|
|
Loading…
Reference in New Issue