Commit Graph

8 Commits

Author SHA1 Message Date
Igor Mandrigin
a122920fa8 and more lint fixes 2021-03-18 11:53:34 +01:00
Igor Mandrigin
7b000b5644 linter fixups 2021-03-18 11:17:04 +01:00
Igor Mandrigin
b9bb65e025 skip headerchain test 2021-03-18 11:00:34 +01:00
Alexey Sharp
534f38f756 Fix lints 2021-03-18 08:30:14 +00:00
Alexey Sharp
469e2534da Fix lints 2021-03-18 07:38:06 +00:00
Igor Mandrigin
fd37289665 fixes to core tests (compilation) 2021-03-16 12:44:38 +01:00
Alexey Sharp
519b19f8aa Compilation fixes 2021-03-14 08:00:37 +00:00
Martin Holst Swende
cb5a995060 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>
# Conflicts:
#	core/blockchain.go
#	core/headerchain.go
#	light/lightchain.go
2021-03-08 14:24:23 +01:00