-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Security fix 4 - Simplify node time and network-adjusted time warning logic #315
Conversation
removes the timeoffset defined in each node, all time functions defined in tapyrus are affected use std::chrono::system_clock is used to get the time in GetTime, GetAdjustedTime, GetSystemTimeInSeconds, GetTimeMillis and GetTimeMicros. This system time takes into account the mocktime used testing also.
…Time, GetAdjustedTime, GetSystemTimeInSeconds, GetTimeMillis and GetTimeMicros. This system time takes into account the mocktime used testing also.
…all to addrandonoutboundpeer
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.
Isn't the nTimeOffset
field in classes CNode
and CNodeStats
also unnecessary?
|
…dd timeoffset to peerinfo in UI
but, |
I tried to remove it, but this is used in the GUI after the previous commit ( |
58603dc
to
abe5184
Compare
Port fix of vulnerability fix of Disclosure of netsplit due to timestamp adjustment which was changed later by PR 29623(Simplify network-adjusted time warning logic)
As this PR removes the
timeoffset
previously defined in each node, the notion of 'adjusted time' is also removed. So a unifiedstd::chrono::system_clock
is used to get the time in GetTime, GetAdjustedTime, GetSystemTimeInSeconds, GetTimeMillis and GetTimeMicros.GetAdjustedTime
andGetTime
are now the same. They return the mockable system time.GetSystemTimeInSeconds
does not allow mocktime. This is essential as the p2p layer depends heavily on the connection and message time. Any change to this time due to mocking results in unpredictable behaviour in functional tests.