Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polygon/sync: span updates #9229

Merged
merged 1 commit into from
Jan 15, 2024
Merged

polygon/sync: span updates #9229

merged 1 commit into from
Jan 15, 2024

Conversation

battlmonstr
Copy link
Contributor

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.

@battlmonstr battlmonstr merged commit c5b75d0 into devel Jan 15, 2024
7 checks passed
@battlmonstr battlmonstr deleted the pr/ccb_span_update branch January 15, 2024 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants