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

Wrong timestamp of Input #75

Closed
tuler opened this issue Sep 2, 2023 · 2 comments
Closed

Wrong timestamp of Input #75

tuler opened this issue Sep 2, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@tuler
Copy link
Member

tuler commented Sep 2, 2023

🙂 Expected behavior

Input.timestamp in the GraphQL server should be number of seconds since epoch.

🫠 Actual behavior

The value is being divided by 1000 by assuming the value that comes from the blockchain was in milliseconds, when in fact it's in seconds.

🧪 Minimal test case

Query the server at
https://0x9f12d4365806fc000d6555acb85c5371b464e506.sepolia.rollups.staging.cartesi.io/graphql

{
  inputs {
    edges {
      node {
        timestamp
      }
    }
  }
}

🌎 Environment

Rollups 1.0.0

✔️ Possible solutions

Fix by assuming the value is in seconds while converting to the NaiveDateTime data type.
Or even better, remove completely the NaiveDateTime data type and leave the original i64 type.
Do we need a NaiveDateTime to do any date handling?

@tuler tuler added the bug Something isn't working label Sep 2, 2023
@gligneul gligneul added this to the 1.0.1 milestone Sep 2, 2023
@gligneul gligneul self-assigned this Sep 4, 2023
@gligneul
Copy link
Contributor

gligneul commented Sep 4, 2023

I confirmed that this was introduced in 0.9 when we refactored the indexer.

@gligneul gligneul modified the milestones: 1.0.1, 1.1.0 Sep 4, 2023
@gligneul
Copy link
Contributor

gligneul commented Sep 5, 2023

Fixed by cartesi/rollups#231

@gligneul gligneul closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants