HomeSource World

core,les: headerchain import in batches (#21471)

Description

core,les: headerchain import in batches (#21471)

  • core: add test for headerchain inserts
  • core, light: write headerchains in batches
  • core: change to one callback per batch of inserted headers + review concerns
  • core: error-check on batch write
  • core: unexport writeHeaders
  • core: remove callback parameter in InsertHeaderChain

The semantics of InsertHeaderChain are now much simpler: it is now an
all-or-nothing operation. The new WriteStatus return value allows
callers to check for the canonicality of the insertion. This change
simplifies use of HeaderChain in package les, where the callback was
previously used to post chain events.

  • core: skip some hashing when writing headers
  • core: less hashing in header validation
  • core: fix headerchain flaw regarding blacklisted hashes

Co-authored-by: Felix Lange <fjl@twurst.com>

Details

Provenance
Martin Holst Swende <martin@swende.se>Authored on Dec 9 2020, 10:13 AM
GitHub <noreply@github.com>Committed on Dec 9 2020, 10:13 AM
Parents
rGETHbd848aad7c4e: common: improve printing of Hash and Address (#21834)
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGETH40b6ccf383cb: core,les: headerchain import in batches (#21471) (authored by Martin Holst Swende <martin@swende.se>).Dec 9 2020, 10:13 AM