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

feature: use timestamp as string for the rpc API #345

Open
p4u opened this issue Nov 4, 2021 · 4 comments
Open

feature: use timestamp as string for the rpc API #345

p4u opened this issue Nov 4, 2021 · 4 comments
Assignees

Comments

@p4u
Copy link
Member

p4u commented Nov 4, 2021

Describe the feature
Use string timestamps instead of int32

Motivation
Support timestamps > year 2038

Proposal
Use integers stored in strings - it's just two more characters, and you entirely sidestep the issue of float precision in json :) In Go, they are natively supported like:

type T struct {
    IntAsString int64 `json:",string"`
}

Components affected
vocdoni-node and dvote-js

Additional information (if required)
This change should be perform in paralel for golang and javascript libraries

@G10h4ck
Copy link
Contributor

G10h4ck commented Feb 18, 2022

Do we need to keep some kind of retro-compatibility with old RPC clients?

@G10h4ck
Copy link
Contributor

G10h4ck commented Feb 21, 2022

Also the problem about 64bit integer is not withing JSON itself but in the languages on which are written the RPC clients, Dart and JavaScript are affected but Go/C++ etc. do not, I guess the RPC clients are written in JavaScript, am I wrong? In that case we have to change the representation of all 64bit integers and not just the timestamps in the RPC protocol.

@jordipainan
Copy link
Member

jordipainan commented Mar 2, 2022

Do we need to keep some kind of retro-compatibility with old RPC clients?

Just saw this @G10h4ck I do not think we need to maintain this retro-compatibility given that the clients we have are updated or in process to be updated to the new specs.

@jordipainan
Copy link
Member

Also the problem about 64bit integer is not withing JSON itself but in the languages on which are written the RPC clients, Dart and JavaScript are affected but Go/C++ etc. do not, I guess the RPC clients are written in JavaScript, am I wrong? In that case we have to change the representation of all 64bit integers and not just the timestamps in the RPC protocol.

Yep you're right, we also have RPC client written in JS, but I do not know if some work around is already implemented, ping @brickpop or @marcvelmer for having better clarity on this. Thank you

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

3 participants