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

Digest verify does not return correct server timestamp of first anchor to include the digest #96

Open
jrick opened this issue Feb 14, 2025 · 3 comments

Comments

@jrick
Copy link
Member

jrick commented Feb 14, 2025

$ curl --silent -XPOST https://time.decred.org:49152/v2/verify/batch --data '{"digests":["d412ba345bc44fb6fbbaf2db9419b648752ecfcda6fd1aec213b45a5584d1b13"]}' | jq .digests.[0].chaininformation.chaintimestamp
1605780312
$ curl --silent -XPOST https://time.decred.org:49152/v2/verify/batch --data '{"timestamps":[1605780312]}' | jq                                                                                                     
{
  "id": "",
  "digests": [],
  "timestamps": [
    {
      "servertimestamp": 1605780312,
      "result": 3,
      "collectioninformation": {
        "chaintimestamp": 0,
        "transaction": "0000000000000000000000000000000000000000000000000000000000000000",
        "merkleroot": "0000000000000000000000000000000000000000000000000000000000000000",
        "digests": []
      }
    }
  ]
}
	// ResultDoesntExistError indiciates the timestamp or digest does not
	// exist.
	ResultDoesntExistError ResultT = 3
@jrick
Copy link
Member Author

jrick commented Feb 14, 2025

I see the issue, timestamp verify works properly but the digest verify is returning what appears to be the collection time, rather than the anchor time (which must be used to verify by timestamp).

@jrick
Copy link
Member Author

jrick commented Feb 14, 2025

or rather than collection time, because that is "chain information", it is probably the block timestamp. Which is rather useless.

the "server timestamp" for that digest verify appears to always show the last hourly anchor time, and not the anchor which first included this digest.

$ date
Fri Feb 14 18:17:47 EST 2025
$ curl --silent -XPOST https://time.decred.org:49152/v2/verify/batch --data '{"digests":["d412ba345bc44fb6fbbaf2db9419b648752ecfcda6fd1aec213b45a5584d1b13"]}' | jq .digests.[0].servertimestamp 
1739574000
$ date -r 1739574000                                                                                                                                                                             
Fri Feb 14 18:00:00 EST 2025

@jrick jrick changed the title Timestamp verify is busted Digest verify does not return correct server timestamp of first anchor to include the digest Feb 14, 2025
@jrick
Copy link
Member Author

jrick commented Feb 15, 2025

As expected, after the next hourly scheduled anchor, the server timestamp for the same digest verify has increased:

$ date                                                                                                                                                                                           
Fri Feb 14 19:01:29 EST 2025
$ curl --silent -XPOST https://time.decred.org:49152/v2/verify/batch --data '{"digests":["d412ba345bc44fb6fbbaf2db9419b648752ecfcda6fd1aec213b45a5584d1b13"]}' | jq .digests.[0].servertimestamp 
1739577600
$ date -r 1739577600
Fri Feb 14 19:00:00 EST 2025

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

No branches or pull requests

1 participant