Clearly identify 32-bit and 64-bit times in serialization and proptests #2171
Labels
A-consensus
Area: Consensus rule updates
A-network
Area: Network protocol updates or fixes
C-security
Category: Security issues
I-consensus
Zebra breaks a Zcash consensus rule
I-invalid-data
Zebra relies on invalid or untrusted data, or sends invalid data
I-panic
Zebra panics with an internal error message
Scheduling
This risk is acceptable for the stable release, but we need to fix it before we support lightwalletd.
Is your feature request related to a problem? Please describe.
Zcash has two serialized time fields: 32-bit seconds, and 64-bit seconds. Zebra also keeps internal 64-bit times with additional 32-bit nanosecond precision.
In general, it's hard to identify, convert, serialize and proptest these different time types correctly.
This is a follow-up to #1849.
Describe the solution you'd like
Make wrapper types for serialized times:
DateTime32
(Add a DateTime32 type for 32-bit serialized times #2210)DateTime64
Tasks for each wrapper type:
datetime_full
anddatetime_u32
proptest strategiesdatetime_full
forDateTime64
by removing nanosecondsReplace
chrono::DateTime<Utc>
with the appropriate types:DateTime32
Use DateTime32 for block times and lock times #2211DateTime64
std::time::Instant
chrono
Describe alternatives you've considered
It would be nice if Zcash just used 64-bit times throughout the protocol.
The text was updated successfully, but these errors were encountered: