@@ -45,7 +45,8 @@ func init() {
4545 flag .StringVar (& exportStatePath , "ExportStatePath" , "" , "custom file path to save the exported app state JSON" )
4646 flag .StringVar (& exportStatsPath , "ExportStatsPath" , "" , "custom file path to save the exported simulation statistics JSON" )
4747 flag .Int64Var (& seed , "Seed" , 42 , "simulation random seed" )
48- flag .IntVar (& numBlocks , "NumBlocks" , 500 , "number of blocks" )
48+ flag .IntVar (& initialBlockHeight , "InitialBlockHeight" , 1 , "initial block to start the simulation" )
49+ flag .IntVar (& numBlocks , "NumBlocks" , 500 , "number of new blocks to simulate from the initial block height" )
4950 flag .IntVar (& blockSize , "BlockSize" , 200 , "operations per block" )
5051 flag .BoolVar (& enabled , "Enabled" , false , "enable the simulation" )
5152 flag .BoolVar (& verbose , "Verbose" , false , "verbose log output" )
@@ -58,16 +59,17 @@ func init() {
5859}
5960
6061// helper function for populating input for SimulateFromSeed
62+ // TODO: clean up this function along with the simulation refactor
6163func getSimulateFromSeedInput (tb testing.TB , w io.Writer , app * SimApp ) (
6264 testing.TB , io.Writer , * baseapp.BaseApp , simulation.AppStateFn , int64 ,
63- simulation.WeightedOperations , sdk.Invariants , int , int , int , string ,
65+ simulation.WeightedOperations , sdk.Invariants , int , int , int , int , string ,
6466 bool , bool , bool , bool , bool , map [string ]bool ) {
6567
6668 exportParams := exportParamsPath != ""
6769
6870 return tb , w , app .BaseApp , appStateFn , seed ,
6971 testAndRunTxs (app ), invariants (app ),
70- numBlocks , exportParamsHeight , blockSize ,
72+ initialBlockHeight , numBlocks , exportParamsHeight , blockSize ,
7173 exportStatsPath , exportParams , commit , lean , onOperation , allInvariants , app .ModuleAccountAddrs ()
7274}
7375
@@ -715,7 +717,7 @@ func TestAppStateDeterminism(t *testing.T) {
715717 simulation .SimulateFromSeed (
716718 t , os .Stdout , app .BaseApp , appStateFn , seed ,
717719 testAndRunTxs (app ), []sdk.Invariant {},
718- 50 , 100 , 0 , "" ,
720+ 1 , 50 , 100 , 0 , "" ,
719721 false , true , false , false , false , app .ModuleAccountAddrs (),
720722 )
721723 appHash := app .LastCommitID ().Hash
@@ -743,7 +745,7 @@ func BenchmarkInvariants(b *testing.B) {
743745 // 2. Run parameterized simulation (w/o invariants)
744746 _ , params , simErr := simulation .SimulateFromSeed (
745747 b , ioutil .Discard , app .BaseApp , appStateFn , seed , testAndRunTxs (app ),
746- []sdk.Invariant {}, numBlocks , exportParamsHeight , blockSize ,
748+ []sdk.Invariant {}, initialBlockHeight , numBlocks , exportParamsHeight , blockSize ,
747749 exportStatsPath , exportParams , commit , lean , onOperation , false , app .ModuleAccountAddrs (),
748750 )
749751
0 commit comments