initial code for epoch related events

It does not work yet, I just want to get some early feedback. I will work on the test if this point to right direction.
Panic is ok, it should be used as way to catch exceptional events. As long as these are the events that we do not want to recover. We will use these panic to figure out what went wrong, and fix the code. In stead of try to figure out how to deal with it. 

In short, panic is ok as long as we do not know what happened or how to deal with it.