Skip to content
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

test: Clean up tests gettime is outdated #143

Open
naftalimurgor opened this issue Mar 5, 2025 · 0 comments · May be fixed by #144
Open

test: Clean up tests gettime is outdated #143

naftalimurgor opened this issue Mar 5, 2025 · 0 comments · May be fixed by #144

Comments

@naftalimurgor
Copy link
Contributor

Summary

The gettime test is outdated:

  • It was originally added in Bitcoin Core to verify the time handling in the MinGW toolchain and detect 32-bit vs 64-bit mismatches. However, the code now relies on std::chrono::system_clock, making the original check unnecessary.
  • Although system_clock could still return incorrect values, any such issue would likely affect all
    - GetTime<> calls, not just those with second-level precision. Such errors would probably trigger signed integer overflows at nanosecond precision, which should either be caught by UBSan or by the assert(ret > 0s) check. If not, the issue would become obvious in the debug log at startup.

Notes

  • For now, the test is can be removed. Alternatively, it could be expanded to cover time handling more comprehensively and updated alongside the block header timestamp logic.
  • However, since that timestamp won’t exceed the year 2106, this is already covered by the _test_y2106 functional test.
naftalimurgor added a commit to naftalimurgor/bitgesell that referenced this issue Mar 6, 2025
@naftalimurgor naftalimurgor linked a pull request Mar 6, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant