cosmos / ibc-go

Inter-Blockchain Communication Protocol (IBC) implementation in Golang.
https://ibc.cosmos.network/
MIT License
553 stars 597 forks source link

Consider converting proof timestamps to secs and floor (ignore nanos) #7512

Open damiannolan opened 1 month ago

damiannolan commented 1 month ago

Since other implementations may just use seconds, I'm wondering if we should instead of using the block time and client timestamp in nanos actually just convert them to seconds and floor it (ie ignore subseconds) to be consistent

In practice, this is a non-issue but worth noting and deciding on before release

Originally posted by @AdityaSripal in https://github.com/cosmos/ibc-go/pull/7464#pullrequestreview-2385153760

damiannolan commented 1 month ago

Note we can do this pretty easily by creating a time.Time with time.Unix(), passing the full prootTimestamp as num nanos, and then calling .Unix()

secsTimestamp := time.Unix(0, proofTimestamp).Unix()
gjermundgaraba commented 1 week ago

Just to be clear, is this issue about potentially changing the light clients to use seconds instead of nanoseconds? @AdityaSripal

Also, is this a Eureka issue?

AdityaSripal commented 1 week ago

We probably will not change the ibc-go light clients directly since we want to still support IBC v1 and minimize changes.

Rather this is about how to convert the nanoseconds from the client to seconds in the v2 handler correctly