Skip to content

Commit 4d23b82

Browse files
authored
Merge pull request #605 from input-output-hk/javierdiaz/trace-verifier-starting-slot
Improve the trace verifier to start from an arbitrary slot
2 parents df04aac + c6a3003 commit 4d23b82

File tree

1 file changed

+7
-4
lines changed
  • leios-trace-verifier/hs-src/app/linear

1 file changed

+7
-4
lines changed

leios-trace-verifier/hs-src/app/linear/Main.hs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ main =
2525
do
2626
Command{..} <- execParser commandParser
2727

28-
-- Prameters from topology
28+
-- Parameters from topology
2929
(top :: Topology COORD2D) <- decodeFileThrow topologyFile
3030
let nrNodes = toInteger $ Prelude.length (elems $ nodes top)
3131
let nodeNames = Prelude.map unNodeName (keys $ nodes top)
@@ -39,9 +39,10 @@ main =
3939
let ldiff = toInteger (linearDiffuseStageLengthSlots config)
4040
let validityCheckTime = 3 -- TODO: read from config
4141
result <-
42-
verifyTrace nrNodes idSut stakeDistribution lhdr lvote ldiff validityCheckTime
43-
. decodeJSONL
44-
<$> BSL.readFile logFile
42+
pure ($ startingSlot)
43+
<*> verifyTraceFromSlot nrNodes idSut stakeDistribution lhdr lvote ldiff validityCheckTime
44+
. decodeJSONL
45+
<$> BSL.readFile logFile
4546
hPutStrLn stderr $ "Applying " <> show (fst result) <> " actions"
4647
unless (fst (snd result) == "ok") $
4748
do
@@ -54,6 +55,7 @@ data Command = Command
5455
{ logFile :: FilePath
5556
, configFile :: FilePath
5657
, topologyFile :: FilePath
58+
, startingSlot :: Integer
5759
, idSut :: Integer
5860
}
5961
deriving (Eq, Ord, Read, Show)
@@ -71,4 +73,5 @@ commandParser =
7173
<$> strOption (long "trace-file" <> help "Leios simulation trace log file")
7274
<*> strOption (long "config-file" <> help "Leios configuration file")
7375
<*> strOption (long "topology-file" <> help "Leios topology file")
76+
<*> option auto (long "starting-slot" <> value 0 <> help "Starting slot of trace-file")
7477
<*> option auto (long "idSut" <> help "Id of system under test (SUT)")

0 commit comments

Comments
 (0)