The updated block is the exact same block with a different header updating the block’s Id in the process. The block that SOLVER_PERF updated does not get invalidated by updating it nor the next block is due to also updating the next block’s previous predecessor on a successful PERF update.
To generate Block Signature: def _sign_block(self, block, identity_signer)
Both the first block found and all of the improved ones are broadcasted as normal, there is no difference between publishing the first and the improved ones.
No, the swap command is meant to make the solvers confirm back their status to the publisher if the solver was idle nothing happens, if the solver was already working it continues working.
PERF → Stopped
PRIM → Working
PRIM → PERF Working on the minted block, previously PRIM, the publisher needs to know this.
PERF → PRIM Stopped and ready to be initialized with a new quiz, then Working.
Generate new block…
PERF → PRIM ; Stopped and ready for a new quiz
PRIM → PERF ; Continues working on the prev block
All completed blocks are published,
An updated block will trigger fork resolution against the unimproved version. Forks of length 1. Given this criteria, best difficulty wins.
A block is not published until the interval time has elapsed, the solver will continue to work on a better solution as long as it has time left.
SOLVER_PRIME : Solve quiz at first, If found nonce, send nonce to the publisher and keep working forever. At Swap cmd, switch identity to SOLVER_PERF.
SOLVER_PERF : Try to Refine the nonce forever until told otherwise.
Time to publish the newest block (not the refined one).
SOLVER_PRIME : Receive new quiz. Previously known as PERF. Solve the quiz. If found nonce, ship it for publishing and keeps working on the same quiz. Change identity to PERF.
SOLVER_PERF : Give up current work. Change Identity. "I’m going to wait new quiz”. Solve the new nonce of new candidate block.
candidate_block : PRIME is on? Yes
candidate_block2 : PERF is on? Yes
claim == publish : block to network
SOLVER_PERF is never gonna give you up as long as there’s time.
SOLVER_PERF was SOLVER_PRIME at 35 diff. It will try to find a better one, if it didn’t is because it ran out of time.
In this situation. there wont be an improved block, there won’t be fork resolution. Happy days.