Skip to content

Commit

Permalink
HACK locli: nable analysis for chains with trace evidence not reachin…
Browse files Browse the repository at this point in the history
…g back to Genesis
  • Loading branch information
mgmeier authored and shlevy committed Apr 16, 2024
1 parent b2742f3 commit 7792e4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
17 changes: 7 additions & 10 deletions bench/locli/src/Cardano/Analysis/BlockProp.hs
Expand Up @@ -401,11 +401,9 @@ rebuildChain run@Run{genesis} flts fltNames xs@(fmap snd -> machViews) =
where go Nothing acc = acc
go (Just hash) acc =
case partitionMbes $ mapMaybe (Map.lookup hash) machBlockMaps of
([], _, ers) -> error $ mconcat
[ "No forger for hash ", show hash
, "\nErrors:\n"
] ++ intercalate "\n" (show <$> ers)
blkEvs@(forgerEv:_, oEvs, ers) ->
-- enable analysis for chains with trace evidence not reaching back to Genesis
([], _, _) -> acc
(forgerEv:_, oEvs, ers) ->
go (bfePrevBlock forgerEv) (liftBlockEvents forgerEv oEvs ers : acc)

liftBlockEvents :: ForgerEvents NominalDiffTime -> [ObserverEvents NominalDiffTime] -> [BPError] -> BlockEvents
Expand Down Expand Up @@ -487,11 +485,10 @@ rebuildChain run@Run{genesis} flts fltNames xs@(fmap snd -> machViews) =
adoptions =
(fmap (`sinceSlot` bfeSlotStart) . Map.lookup bfeBlock) `mapMaybe` adoptionMap

otherBlocks = otherBlockHashes <&>
\blk ->
let forger = findForger blk in
(forger,
fail' (bfeHost forger) bfeBlock (BPEFork blk))
-- enable analysis for chains with trace evidence not reaching back to Genesis
-- HACK: for this, we currently have to sacrifice analysing chain forks for height/slot battles
otherBlocks = []

otherBlockHashes = Map.lookup bfeBlockNo heightMap
& strictMaybe
& handleMiss "height map"
Expand Down
2 changes: 1 addition & 1 deletion nix/workbench/analyse/analyse.sh
Expand Up @@ -232,7 +232,7 @@ EOF

standard | full | std )
local script=(
hash-timeline
# hash-timeline
logs $(test -n "$dump_logobjects" && echo 'dump-logobjects')
read-context

Expand Down

0 comments on commit 7792e4a

Please sign in to comment.