-
Notifications
You must be signed in to change notification settings - Fork 71
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
[4.0 -> main] P2P: Use magnitude safe time types #1321
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5dbcdc5
GH-1315 Use magnitude safe time types
heifner b221c12
GH-1315 Reset latest_msg_time and latest_blk_time so re-connect doesn…
heifner 0b3b3b6
GH-1315 Completely remove problematic tstamp type.
heifner e9016b0
Merge pull request #1316 from AntelopeIO/GH-1315-time-4.0
heifner c8c6c5e
Merge remote-tracking branch 'origin/release/4.0' into GH-1315-time-main
heifner 197d37e
GH-1315 Fix merge issue
heifner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
I'd prefer have these all be
tstamp
as before, but withtstamp
defined asstd::chrono::nanoseconds
.If we want to differentiate between a point in time (since the epoch), i.e
time_point
, and aduration
, then org/rec/xmt/dst should betime_point
, and not durations.Also I don't think it is a good idea to use
std::chrono::system_clock::time_point
ourselves because the duration of the system_clock is not specified.So I think the most straightforward thing might be to use
tstamp
defined asstd::chrono::nanoseconds
for both actual timestamps (i.e. time since epoch) and durations. Because it is a duration from std::chrono, we benefit from type safety insuring that we don't addstd::chrono::nanoseconds
andstd::chrono::milliseconds
, but we use a consistent internal representation. I think it would make the code simpler and clearer.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.
I created #1326 as this is a merge up PR, I think it makes sense to make these changes in a separate PR.