tapyrus-core icon indicating copy to clipboard operation
tapyrus-core copied to clipboard

Security fix 4 - Simplify node time and network-adjusted time warning logic

Open Naviabheeman opened this issue 5 months ago • 0 comments

Port fix of vulnerability fix of CVE-2020-14198 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 unified std::chrono::system_clock is used to get the time in GetTime, GetAdjustedTime, GetSystemTimeInSeconds, GetTimeMillis and GetTimeMicros.

  • GetAdjustedTime and GetTime 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 in tests results in unpredictable behaviour.

Naviabheeman avatar Sep 24 '24 12:09 Naviabheeman