feat(fc): prove FC-4 the fork-choice tree is acyclic - #44
Merged
Conversation
Store/Ancestry.lean states block ancestry relationally: ProperAncestor st a d holds when parent_root links from d reach a in one or more steps inside the store. Upstream has no standalone helper - the convention lives in the _checkpoint_is_ancestor walk and in the parent-slot ordering established at block insertion, stated here as WellFormed.parentSlotLt (leanEthereum/leanSpec#1176). properAncestor_slot_lt shows slots strictly decrease along every proper-ancestor step, so a self-ancestor cycle would put a block's slot strictly below itself: fork_choice_acyclic.
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.
Summary
Second FC proposition, building on the
Storemodel andStore.WellFormedfrom #43.Approach
Store/Ancestry.leanstates block ancestry relationally:ProperAncestor st a dholds whenparent_rootlinks fromdreachain one or more steps inside the store. Upstream has no standaloneis_proper_ancestorhelper — the convention lives in the_checkpoint_is_ancestorwalk (already modeled ascheckpointIsAncestor) and in the parent-slot ordering established at block insertion (on_blockruns the STF, which admits only strictly-future slots), stated asWellFormed.parentSlotLt(leanEthereum/leanSpec#1176).Theorems
ProperAncestor.descendant_block— the descendant end of every derivation is a stored blockgetBlock?_isSome_of_mem— a stored entry makes the lookup succeedproperAncestor_slot_lt— slots strictly decrease along proper ancestry on a well-formed storefork_choice_acyclic(FC-4) — no stored block is a proper ancestor of itself: a cycle would put the block's slot strictly below itselfCatalog: FC-4 checked (with a note that blocks are keyed pairs, so the statement quantifies over
p ∈ st.blocks), progress table 18/12/1.lake buildpasses with nosorry.