Fix a bug in simulated next instance start time #183
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The simulation has configurations to set the length of an epoch as well as a stabilisation delay before it starts the next instance after one finishes.
Since the original implementation the code has undergone a number of iterations one of which removed epoch from tipset. Since that change, the simulation seem to have been using a fixed next start time upon receiving a decision. The start time is an absolute time; therefore using a fixed time meant that the simulation was not waiting for the configured stabilization in between instances.
Additionally, because the returned start time is used as deliver at timestamp by the simulated network transport alerts may have been fired immediately after a participant received a decision, before all participants finished deciding. This is fine as far as constraints of GPBFT algorithm is concerned. Which is why simulation tests have been passing so far. But it diverges from the intended simulation conditions.
The changes here fix the above issue by setting the next start time to the configured length of one epoch plus the configured stabilization delay relative to the current network time. This means the next instance start progresses as the time in the network does.
Further, the changes here remove the base timestamp field from simulated EC state as it seems to be unused.