-
Notifications
You must be signed in to change notification settings - Fork 375
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
Transaction signature bytes always use an uninitialized timestamp #810
Labels
Milestone
Comments
zivkovicmilos
changed the title
Transaction signature bytes require an uninitialized timestamp
Transaction signature bytes always use an uninitialized timestamp
May 8, 2023
ajnavarro
added
🐞 bug
Something isn't working
📦 🌐 tendermint v2
Issues or PRs tm2 related
and removed
bug
labels
May 15, 2023
Related with #1511 |
7 tasks
zivkovicmilos
added a commit
that referenced
this issue
Apr 29, 2024
## Description This PR closes #810 I've dropped the unused `Timestamp` field from the `SignDoc`, which forced all clients that generate tx signatures outside of the `gno` repo to initialize it to an empty UTC timestamp value (ex. Adena, `tm2-js-client`...) **BREAKING CHANGE**: all clients that generate transaction signatures without using the provided Go methods in this repository need to update their source code to remove the `Timestamp` field. (@dongwon8247 @jefft0) I've also provided error handling for generating these signature bytes, which weren't present before. <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
github-project-automation
bot
moved this from In Progress
to Done
in 🧙♂️gno.land core team
Apr 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The signature base for transactions is generated from the
SignDoc
structure, which has a field calledTimestamp
(ISO string).This
Timestamp
field goes into the transaction signature bytes uninitialized (as the default value oftime.Time
:0001-01-01T00:00:00Z
).gno/tm2/pkg/std/doc.go
Lines 19 to 38 in 0aaee73
This means that the
Timestamp
for any transaction signature needs to be0001-01-01T00:00:00Z
, as the actual transaction timestamp is not read at all (doesn't go intoSignDoc
).Of course, this means that any transaction signature that has a valid timestamp (different from
0001-01-01T00:00:00Z
) will be considered invalid, because thegno
verifier code generates the sign bytes assuming it's the default value@moul
I'm not sure if we'd be breaking backwards compatibility by making sure the transaction sign bytes take into account the valid transaction signature timestamp instead of the default value
The text was updated successfully, but these errors were encountered: