TrueBitFoundation / truebit-os

[DEPRECATED] Interactive client
Apache License 2.0
82 stars 26 forks source link

Recovery mode #70

Closed mrsmkl closed 6 years ago

mrsmkl commented 6 years ago

Started working on recovery mode. Work in progress, but nothing should be broken.

mrsmkl commented 6 years ago

The idea is to check events from previous blocks to find out what the clients should do.

hswick commented 6 years ago

It would be great to have some documentation in the README on how to demo the recovery option.

I tried running the client with the command line, starting a task, submitting solution, then turning it off and on and again and trying to resume the task, but didnt seem to work.

mrsmkl commented 6 years ago

You'll have to start the solver with "-r 100", then it should check back 100 blocks for events that might be related to tasks. There are some rough edges, but just adding more listened events will solve some of them.

hswick commented 6 years ago

Which phases have you tested it on? I'm able to get the recovery to start if I set the correct number of blocks.

However, testing it during the challenge period, the solver keeps solving the task again and then tries to submit the solution again, which results in a revert. Looks like it needs some kind of logic to check if it submitted the solution already.

Same thing happens after challenge period as well.

mrsmkl commented 6 years ago

The logic is that it handles the last event associated with the task. So for example a listener for SolutionsCommitted event would have to be added to the solver. But if it tried to submit at verification game, then there is an error because there was EndRevealPeriod event. But check that this wasn't another task posted within those blocks.

hswick commented 6 years ago

This is great. I tried it out on before and after challenge period and got it to work.