-
Notifications
You must be signed in to change notification settings - Fork 3
Enhance: Blocksmith Selection #1190
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
Comments
iltoga
pushed a commit
that referenced
this issue
Nov 3, 2020
* remove active node registry when participation score reach 0 * calculateNodeOrder divide by 1, it is not used anymore, will be removed in new blocksmith selection implementation #1190 * omit division * fix tests * remove outdated test
sukrawidhyawan
pushed a commit
that referenced
this issue
Nov 16, 2020
* update func WillSmith, isMe, IsBlockValid on BlocksmithStrategySpine * create func CumulativeDifficulty on strategy * add getRound and temporary-CanPersist function * remove func GetSortedBlocksmithsMap from package strategy * add getSkippedBlocksmith functioon * add new func , remove func , change blocksmithIndex to round * remove parameter 'block' in isMe func * #1190 inject random number generator to strategy main * #1190 fix candidate time calculation * #1190 separate get smithing round and smithing index function * #1190 temporarily disable spinechain smithing * Implementated the new blocksmith selection on spinechain * #1190 handle previous block skipped blocksmith - blocktime offset. * #1190 avoid process node-admit, node-expel, blocksmith reward, and skipped blocksmith before accepted/generated block is sure to be persisted to database * #1190 use estimated persist timestamp for block validation Co-authored-by: andy-shi88 <[email protected]>
sukrawidhyawan
pushed a commit
that referenced
this issue
Nov 17, 2020
…ore or askipped blocksmith (#1352)
iltoga
pushed a commit
that referenced
this issue
Nov 18, 2020
sukrawidhyawan
pushed a commit
that referenced
this issue
Nov 20, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Currently blocksmith is selected by sorting the
node registry
and assign index of smithing based on their order.We'll update that behavior to use random number generator to pick an index of
sorted node registry
(sorted by nodeID so we sort rarely) by usingpreviousBlock.BlockSeed
as the seed. With this we open the possibility to let first and second blocksmith be the same node, so we need to handle this carefully given the implementation on mempool and block generate wait time.note: start tracing this function on
BlockService:WillSmith()
function.Breakdown
BlocksmithStrategy
BlocksmithStrategy.WilSmith
should checks ifcurrent_time
is good forcurrent_node
to smithBlocksmithStrategy.IsSmithingTimeValid
, should checks if providedBlock
contain a correctBlocksmithPublicKey
andBlockTimestamp
regardless the node's current time.generate random number for blocksmith index (still waiting for decision which to choose), by providing:
modify skipped blocksmith mechanism to allow 1 blocksmith to skip twice.
modify block creation code to handle in case single node selected as blocksmith twice in a row.
The text was updated successfully, but these errors were encountered: