Commit Graph

6 Commits

Author SHA1 Message Date
battlmonstr
2793ef6ec1
polygon: flatten redundant packages (#9241)
* move mocks to the owner packages
* squash single file packages
* move types to more appropriate files
* remove unused mocks
2024-01-16 09:23:02 +01:00
battlmonstr
c5b75d00ca
polygon/sync: span updates (#9229)
It is possible that a span update happens during a milestone.
A headers slice might cross to the new span.
Also if 2 forks evolve simulaneously, a shorter fork can still be in the
previous span.
In these cases we need access to the previous span to calculate
difficulty and validate header times.

SpansCache will keep recent spans.
The cache will be updated on new span events from the heimdall.
The cache is pruned on new milestone events and in practice no more than
2 spans are kept.

The header difficulty calculation and time validation depends on having
a span for that header in the cache.
2024-01-15 12:36:25 +01:00
battlmonstr
c11e5047fb
polygon: refactor header.Time validation (#9213) 2024-01-12 16:11:01 +01:00
battlmonstr
9c47cce62c
bor: move to polygon directory (#9174) 2024-01-09 19:20:42 +01:00
battlmonstr
2521f47e7b
polygon/sync: canonical chain builder unit tests (#9137) 2024-01-08 15:55:43 +01:00
battlmonstr
b57cbdcff7
polygon/sync: canonical chain builder (#9117) 2024-01-04 10:44:57 +01:00