fix: compare serialized timestamps in seconds#58
Conversation
Convert nearby CoinJoin, governance, spork, LLMQ, RPC, and test code to chrono time points and durations. Preserve serialized, signed, hashed, and RPC-facing timestamps as integer Unix seconds with explicit conversions at those boundaries.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
f5e834c to
40e554c
Compare
|
Closing as superseded: the target branch was force-updated to 40e554c and now contains the serialized-timestamp overflow fixes and focused regression coverage directly. This child PR is therefore redundant and conflicted. Fresh CI/review continues on dashpay#7459 at that head. |
Issue being fixed or feature implemented
The Dash-specific adaptation in dashpay#7459 compares serialized
int64_ttimestamps in seconds with native-resolutionNodeClock::time_pointvalues. The implicit common-duration conversion scales peer-controlled values to microseconds or nanoseconds and can overflow signed integers before the comparison.What was done?
How Has This Been Tested?
Tested on macOS/aarch64 with an undefined-behavior-sanitized build:
CCACHE_DISABLE=1 make -C src -j15 test/test_dashUBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 ./src/test/test_dash --run_test=chrono_overflow_tests --log_level=messageUBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 ./src/test/test_dash --run_test=chrono_overflow_tests/governance_vote_future_time_extreme --log_level=test_suiteUBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 ./src/test/test_dash --run_test=chrono_overflow_tests,governance_vote_wire_tests,governance_validators_tests,coinjoin_queue_tests,ratecheck_tests --log_level=messageclang-format --dry-run --Werror src/test/chrono_overflow_tests.cppgit diff --check f5e834c0f9011e523725684c543b055a7ea86621..HEADAll tests and checks passed.
Breaking Changes
None.
Checklist: