-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time-invariant event log #2382
Time-invariant event log #2382
Conversation
Draft-comments: I started doing 2 separate PRs for separating:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there tests for this change?
// Because a # of blocks limit is too fragile when using fast blocks for | ||
// tests.) | ||
func decodeAndCheckEvent(rst byzcoin.ReadOnlyStateTrie, eventBuf []byte) (*Event, error) { | ||
// Check the timestamp of the event: it should never be in the future beyond the current block, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you accept 4 * config.BlockInterval
, which is fine, but doesn't match your comment here.
// eventDelayTolerance indicates how much time after the event timestamp | ||
// we are stilling willing to accept an event as genuine and contemporaneous, | ||
// and hence as valid. Expressed in [ns] | ||
const eventDelayTolerance = time.Duration(-60 * 1e9) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const eventDelayTolerance = time.Duration(-60 * 1e9) | |
const eventDelayTolerance = time.Minute |
And reverse the comment to say before, as well as changing the code.
You can rebase to master, the updates to the testing framework should make it work more reliable now. And if new tests fail, it'll be easier to make them pass... |
In fact the latest travis test failed because of an error in coveralls... |
@pierluca bumping this, as the |
Thanks for the information @ineiti. |
Is this something you think working on, or should it be closed? You might want to delegate it ;) |
Considering Cothority is reaching C4DT support's end-of-life in April 2022 and that this feature is not currently used by any production system, I'm closing this PR. I'd be happy to pick it up again later should it become relevant / a priority. |
This pull requests deals with #2376 and adds a few documentation fixes.
It makes the event log contract time-invariant by referring exclusively to the current block timestamp rather than
time.Now()
I'm still looking into the unit-tests.
🙅 Friendly checklist:
xerrors.Errorf
and the%v
verb.