You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we move to lambda, when we move from one input to the next, we will restore the machine back to the template (and carry over the dapp state only). This includes restoring the value of mcycle, on which the value of mtime = rtc_cycle_to_time(mcycle) is based. This means that, from the point of view of the system running inside the machine, no time was elapsed at all. Every input starts processing at the same time. It is a bit odd.
Moreover, to simplify disputes, it might be good to have mcycle zeroed out before each input is processed. At the moment, if we do that, we will move time backwards. This is problematic for a running system.
Possible solutions
The idea is to add a new CSR, called mtimebase. Then, we set mtime = mtimebase + rtc_cycle_to_time(mcycle).
When we want to reset mcycle, all we have to do is first set mtimebase = mtimebase + rtc_cycle_to_time(mcycle), and then set mcycle = 0. Time will not move backwards anymore.
The text was updated successfully, but these errors were encountered:
I think we need to reevaluate our notion of cycle counter because of lambda and because of current discussions of the machine stack and alternatives to the machine stack. @miltonjonat
Context
When we move to lambda, when we move from one input to the next, we will restore the machine back to the template (and carry over the dapp state only). This includes restoring the value of
mcycle
, on which the value ofmtime = rtc_cycle_to_time(mcycle)
is based. This means that, from the point of view of the system running inside the machine, no time was elapsed at all. Every input starts processing at the same time. It is a bit odd.Moreover, to simplify disputes, it might be good to have
mcycle
zeroed out before each input is processed. At the moment, if we do that, we will move time backwards. This is problematic for a running system.Possible solutions
The idea is to add a new CSR, called
mtimebase
. Then, we setmtime = mtimebase + rtc_cycle_to_time(mcycle)
.When we want to reset
mcycle
, all we have to do is first setmtimebase = mtimebase + rtc_cycle_to_time(mcycle)
, and then setmcycle = 0
. Time will not move backwards anymore.The text was updated successfully, but these errors were encountered: