Skip to content

Commit

Permalink
WIP ChainGenerator.Alternative: fixup youngestStableA defition
Browse files Browse the repository at this point in the history
I /think/ this is an improvement, but I'm not sure yet if it's fully correct.
  • Loading branch information
nfrisby committed Aug 31, 2023
1 parent ce2957b commit 7f8d9ce
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,24 @@ checkAdversarialChain recipe adv = do
-- the rest of the function won't force this since there are no
-- adversarial active slots
error "dead code"
kPlus1stYoungest = case BV.findIthEmptyInV S.inverted vH (C.toIndex arPrefix C.+ k) of
BV.JustFound kPlus1st -> C.fromWindow winH $ kPlus1st C.+ d
BV.NothingFound -> C.Count d
kPlus1stYoungestPlusDelta = case BV.findIthEmptyInV S.inverted vH (C.toIndex arPrefix C.+ k) of
BV.JustFound kPlus1st -> C.fromWindow winH kPlus1st C.+ d
BV.NothingFound ->
-- If the honest chain didn't reach @k+1@ before it ended, then
-- the adversary cannot acclerate before the honest chain ends.
--
-- The following value is inaccurate, since it is definitely
-- less than @d@ after the @k+1@st block. However, it's great
-- enough to prevent the test from ending while the adversary
-- has @k@ or more active slots remaining.
--
-- TODO if the honest chain has @x < k+1@ remaining blocks,
-- then @(k+1) - x + d@ is the exact answer, isn't it? By
-- appeal to the conservative assumption that slots after 'Len'
-- are active on the honest schema.
C.Count d -- C.windowLast winH
in
max sYoungest kPlus1stYoungest
max sYoungest kPlus1stYoungestPlusDelta

checkRaces = do
let iterH =
Expand Down

0 comments on commit 7f8d9ce

Please sign in to comment.