You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
Change check described below to check for currentBlockData === null.
time can be set directly when calling modules.blocks.process.generateBlock.
Actual behavior
Function modules.delegates->__private.getBlockSlotData is using following logic:
Call generateDelegatesList.
Iterate 101 times (through slots) until it finds delegate public key in __private.keypairs.
Returns slot time together with corresponding keypair or null if it cannot found delegate on the list (forging enabled, but delegate is not the active one).
Expected behavior
Logic in
modules.delegates->__private.getBlockSlotData
should be something like following:generateDelegatesList
.keypair
when delegate for current slot exists in__private.keypairs
(forging enabled) ornull
if not.Then in
__private.forge
:currentBlockData === null
condition form:https://github.com/LiskHQ/lisk/blob/7922d346e115406a0004aa729e2ecfd18c5d43e4/modules/delegates.js#L258
currentBlockData === null
.time
can be set directly when callingmodules.blocks.process.generateBlock
.Actual behavior
Function
modules.delegates->__private.getBlockSlotData
is using following logic:generateDelegatesList
.__private.keypairs
.null
if it cannot found delegate on the list (forging enabled, but delegate is not the active one).This function is called form
__private.forge
in the same module, but later we have a check here:https://github.com/LiskHQ/lisk/blob/7922d346e115406a0004aa729e2ecfd18c5d43e4/modules/delegates.js#L263-L265 This check is
true
most of the times because delegate can forge only once during the round (in perfect conditions).This logic is redundant and unnecessary complex.
Steps to reproduce
N/A
Which version(s) does this affect? (Environment, OS, etc...)
>= 1.0.0
The text was updated successfully, but these errors were encountered: