iota.js icon indicating copy to clipboard operation
iota.js copied to clipboard

Update parent block ids during local PoW

Open Thoralf-M opened this issue 2 years ago • 0 comments

Description

Update parent block ids with new tips during local PoW if it takes more than ~5 seconds.

Motivation

So the final block will always reference new tips and there is no "invalid parameter, error: block is below max depth: invalid block: code=400, message=invalid parameter" error even if the PoW would take very long. Since the PoW is random it doesn't make it really slower when one updates the tips (apart from the time actually updating the block with the new tips).

Requirements

  1. During PoW check the time it's taking
  2. If it runs longer than ~5 seconds? request new tips from the node, update the block and restart PoW
  3. Do this in a loop until a valid nonce was found

Are you planning to do it yourself in a pull request?

No.

Thoralf-M avatar Aug 02 '22 08:08 Thoralf-M