Commit Graph

5 Commits

Author SHA1 Message Date
Jordan Hrycaj 2d6bf34175
Re-adjust canonical head to parent of block to be inserted (#726)
* Re-adjust canonical head to parent of block to be inserted

why:
  of the failing tests that remain to be solved, 30 of those will succeed
  if the canonical database chain head is cleverly adjusted -- yes, it
  looks like a hack, indeed.

details:
  at the moment, this hack works for the non-hive tests only and is
  triggered by a boolean argument passed on to the chain.persistBlocks()
  method.

* Use parent instead of canonical head for block to be inserted

why:
  side chains need to be inserted typically somewhere before the
  canonical head.

details:
  the previous _hack_ was unnecessary and removed, it was inspired by
  some verification in persistBlocks() which explicitly referenced the
  canonical head (which now might or might not refer to the newly inserted
  header.)

* remove unnecessary code + comment
2021-06-22 17:52:31 +01:00
jangko 5fc57e4093
add validateKinship in persistBlocks of nimbus/p2p/chain.nim
put jordan's work #668 into effect, and this bring down
failing consensus test cases from 59 to 44
2021-05-27 16:28:26 +07:00
jangko d2b47139e1
fixes `importRlpBlocks` in conf_utils.nim
now we are importing block one by one to satisfy
some of hive test cases.

we also catch exception instead of letting it terminate the
process.
2021-05-17 18:43:44 +07:00
jangko 287f1b2ba0
fixes `importRlpBlock` algorithm
it will skip blocks with blockNumber <= than current
head blockNumber
2021-04-30 12:56:18 +07:00
jangko 2cd081495b implement '--import': import rlp encoded block(s), validate, write to db and quit 2021-03-23 10:37:00 +07:00