This is mainly more of a question/concern...
The TestAppSimulationAfterImport simulation test executes a simulation like normal and then exports the application state. Finally, a second app is created and InitChain is called with the exported state -- essentially importing the state:
newApp.InitChain(abci.RequestInitChain{
AppStateBytes: appState,
})
After doing this we call SimulateFromSeed to run simulation on the new app with imported state. However, SimulateFromSeed generates its own random app state through AppStateFn and calls InitChain.
So at first glance it seems we're not actually simulating a true import? The 1st InitChain call seems ineffectual...?
Is this line of thinking correct @cwgoes?
/cc @fedekunze
Hmm that does sound problematic; there was a point at which we were simulating an imported state but possibly AppStateFn changed after that, I'm not too familiar with the current state of the code.
I think the desired behaviour is still to import the state and start from a particular seed (without overwriting the imported state).
Ok, thanks! Seems like my line of reasoning was correct then and this is problematic as it's not testing what we expect it to.
@fedekunze I think we should resolve this asap.
A quick and simple attempt of a fix could be to pass a parameter of config value to SimulateFromSeed to bypass InitChain and use a provided state instead.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Ok, thanks! Seems like my line of reasoning was correct then and this is problematic as it's not testing what we expect it to.
@fedekunze I think we should resolve this asap.
A quick and simple attempt of a fix could be to pass a parameter of config value to
SimulateFromSeedto bypassInitChainand use a provided state instead.