feat(#96): FRC-0089 EC finality calculator (observed-data finality)#105
Merged
Conversation
…ithout F3 Port of lotus chain/ecfinality (itself a Go port of the FRC-0089 Python reference). Math kept verbatim so the lotus/Python test vectors apply unchanged - all reference vectors pass. What it gives Lantern: an upper bound on reorg probability computed from OBSERVED block counts per epoch, with no external trust. Healthy chain (~5 blk/epoch) meets 2^-30 around depth ~30 (~15 min) instead of the static worst-case 900 epochs. This quantifies how deep a tip-range eclipse could plausibly reorg us (head-trust epic #100), and becomes the retention-depth input for #92 and the ec-finalized half of the v2 'finalized'/'safe' selector semantics (#99). Lantern adaptations (cache.go, new): - HeaderSource interface over chain/header/store (Head + GetTipSet) - Windowed-store aware: the walk stops gracefully where history runs out; Status reports the achieved WindowEpochs, and a window below MinWindow (30 epochs) reports 'not computable' (-1) instead of an over-confident number. Nodes with a deeper tail (#91) converge to the exact reference behavior. - On-demand + cached per head tipset: an idle node pays nothing; the dashboard poll is the only thing that pays the Skellam cost. Wiring: - cmd/lantern: dashboard dev page gets an 'EC finality (FRC-0089)' card (threshold depth / ec-finalized epoch / observed window / recomputes) plus the previously-invisible held_uncorrob / held_diverged / rejected_lighter ingestor counters. - pkg/daemon: Daemon.ECFinality() accessor for embedded consumers. - TRUST-MODEL.md 2.7: computed bound, not a proof; F3 precedence; finalized = max(ec, f3). New dep: github.com/rvagg/go-skellam-pmf v0.0.2 (tiny, pure Go, same dep lotus uses).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of lotus
chain/ecfinalitywith the math verbatim: all Python-reference test vectors pass unchanged.What
chain/ecfinality: FRC-0089 calculator + Lantern-adapted per-head cache over the header store.Daemon.ECFinality()for embedded (curio-core) consumers.Verification
New dep:
github.com/rvagg/go-skellam-pmfv0.0.2 (pure Go, tiny, same as lotus).Closes #96.