-
Notifications
You must be signed in to change notification settings - Fork 955
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
Enforce consistent datetime serialization #3389
Conversation
a587e9b
to
1ef2adf
Compare
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.
looks good, just in crates/apps_lib/src/cli.rs
pls update help for NAMADA_START_TIME
1ef2adf
to
7f38267
Compare
7f38267
to
3352219
Compare
3352219
to
834a468
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3389 +/- ##
=======================================
Coverage 53.92% 53.93%
=======================================
Files 317 317
Lines 107575 107610 +35
=======================================
+ Hits 58011 58037 +26
- Misses 49564 49573 +9 ☔ View full report in Codecov by Sentry. |
834a468
to
c18864e
Compare
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.
Looks good to me. Thanks!
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.
Just to be sure that hardware wallet will continue to work, could we please demonstrate in a unit test that DateTimeUtc
is a subset of DateTime
somewhere?
* tiago/consistent-datetime-serialization: Changelog for #3389 Improve tx salting Fix from tm time impl for `DateTimeUtc` Misc fixes Increase gas limit in `FinalizeBlock` tests Rebuild tx fixtures Resign localnet genesis txs Rebuild wasms for tests gen_localnet.py: Fix genesis time string Add datetime encoding tests Enforce fixed RFC3339 format
Co-authored-by: Yuji Ito <[email protected]>
0ac361d
to
7f90393
Compare
This PR works with the hardware wallet. We just need to make a (hopefully) minor change on the hardware wallet to increase the precision it displays. See for instance the following where
|
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.
Looks good to me. Thanks!
Test vectors contain data not found in serializations.
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.
Could we please change the line
namada/crates/sdk/src/signing.rs
Line 1917 in 7f90393
format!("Timestamp : {}", tx.header.timestamp.0), |
format!("Timestamp : {}", tx.header.timestamp),
? This will change the expected output on the Ledger app from 2 | Timestamp : 4900-04-22 06:26:45.041754692 UTC
to something like 3 | Timestamp : 4440-02-19T23:31:34.674481+00:00
. This is required because the Borsh serialization does not contain the last 3 decimal places.
Either we do the above, or we increase the number of decimal places in the Borsh serialization of a DateTimeUtc
so that the hardware wallet is able to meet the precise expectations.
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.
Great! This PR does not break the hardware wallet. Thanks!
* tiago/consistent-datetime-serialization: Changelog for #3389 Regen tx fixtures Resign localnet genesis txs Rebuild wasms for tests gen_localnet.py: Fix genesis time string Increase precision of timestamps to 9 nanos Fix genesis time in tests Keep nanoseconds during CometBFT time conversions Switch to fixed offset format in UTC Increase robustness of datetime test Improve tx salting Fix from tm time impl for `DateTimeUtc` Misc fixes Increase gas limit in `FinalizeBlock` tests Add datetime encoding tests Enforce fixed RFC3339 format
* tiago/consistent-datetime-serialization: Changelog for #3389 Regen tx fixtures Resign localnet genesis txs Rebuild wasms for tests gen_localnet.py: Fix genesis time string Increase precision of timestamps to 9 nanos Fix genesis time in tests Keep nanoseconds during CometBFT time conversions Switch to fixed offset format in UTC Increase robustness of datetime test Improve tx salting Fix from tm time impl for `DateTimeUtc` Misc fixes Increase gas limit in `FinalizeBlock` tests Add datetime encoding tests Enforce fixed RFC3339 format
* origin/tiago/consistent-datetime-serialization: Changelog for #3389 Regen tx fixtures Resign localnet genesis txs Rebuild wasms for tests gen_localnet.py: Fix genesis time string Increase precision of timestamps to 9 nanos Fix genesis time in tests Keep nanoseconds during CometBFT time conversions Switch to fixed offset format in UTC Increase robustness of datetime test Improve tx salting Fix from tm time impl for `DateTimeUtc` Misc fixes Increase gas limit in `FinalizeBlock` tests Add datetime encoding tests Enforce fixed RFC3339 format
Describe your changes
Our
DateTimeUtc
type allowed a relaxed representation of RFC3339 strings. We now enforce a string subset of this format, to guarantee deterministic serialization.Indicate on which release or other PRs this topic is based on
v0.39.0
Checklist before merging to
draft